Index: common/src/java/org/apache/hadoop/hive/conf/HiveConf.java =================================================================== --- common/src/java/org/apache/hadoop/hive/conf/HiveConf.java (revision 1030336) +++ common/src/java/org/apache/hadoop/hive/conf/HiveConf.java (working copy) @@ -306,6 +306,8 @@ HIVEFETCHOUTPUTSERDE("hive.fetch.output.serde", "org.apache.hadoop.hive.serde2.DelimitedJSONSerDe"), SEMANTIC_ANALYZER_HOOK("hive.semantic.analyzer.hook",null), + + HIVE_AUTHORIZATION_MANAGER("hive.security.authorization.manager", null), ; Index: metastore/if/hive_metastore.thrift =================================================================== --- metastore/if/hive_metastore.thrift (revision 1030336) +++ metastore/if/hive_metastore.thrift (working copy) @@ -29,11 +29,24 @@ 4: optional list fields // if the name is one of the user defined types } +struct PrincipalPrivilegeSet { + 1: map userPrivileges, // user name -> privilege set + 2: map groupPrivileges, // group name -> privilege set + 3: map rolePrivileges, //role name -> privilege set +} + +struct Role { + 1: string roleName, + 2: i32 createTime, + 3: string ownerName, +} + // namespace for tables struct Database { 1: string name, 2: string description, 3: string locationUri, + 4: optional PrincipalPrivilegeSet privileges } // This object holds the information needed by SerDes @@ -76,7 +89,8 @@ 9: map parameters, // to store comments or any other user level parameters 10: string viewOriginalText, // original view text, null for non-view 11: string viewExpandedText, // expanded view text, null for non-view - 12: string tableType // table type enum, e.g. EXTERNAL_TABLE + 12: string tableType, // table type enum, e.g. EXTERNAL_TABLE + 13: optional PrincipalPrivilegeSet privileges, } struct Partition { @@ -86,7 +100,8 @@ 4: i32 createTime, 5: i32 lastAccessTime, 6: StorageDescriptor sd, - 7: map parameters + 7: map parameters, + 8: optional PrincipalPrivilegeSet privileges } struct Index { @@ -109,6 +124,60 @@ 2: map properties } +struct ColumnPrivilegeBag { + 1: string dbName, + 2: string tableName, + 3: map columnPrivileges +} + +struct PrivilegeBag { + 1: string userPrivileges, //user privileges + 2: map dbPrivileges, //database privileges + 3: map tablePrivileges, //table privileges + 4: map partitionPrivileges, //table privileges + 5: list columnPrivileges, //column privileges +} + +struct SecurityUser { + 1: string principalName, + 2: bool isRole, + 3: bool isGroup, + 4: string privileges, + 5: i32 createTime, + 6: string grantor, +} + +struct SecurityDB { + 1: string principalName, + 2: bool isRole, + 3: bool isGroup, + 4: string privileges, + 5: i32 createTime, + 6: string grantor, + 7: Database db, +} + +struct SecurityTablePartition { + 1: string principalName, + 2: bool isRole, + 3: bool isGroup, + 4: string privileges, + 5: i32 createTime, + 6: string grantor, + 7: Table table, + 8: Partition part, +} + +struct SecurityColumn { + 1: string principalName, + 2: bool isRole, + 3: bool isGroup, + 4: string privileges, + 5: i32 createTime, + 6: string grantor, + 7: Table table, + 8: string column, +} exception MetaException { 1: string message @@ -265,6 +334,42 @@ throws(1:NoSuchObjectException o1, 2:MetaException o2) list get_index_names(1:string db_name, 2:string tbl_name, 3:i16 max_indexes=-1) throws(1:MetaException o2) + + //authorization privileges + PrincipalPrivilegeSet get_user_privilege_set (1: string user_name, 2: list group_names) + throws(1:MetaException o1) + PrincipalPrivilegeSet get_db_privilege_set (1: string db_name, 2: string user_name, 3: list group_names) + throws(1:MetaException o1) + PrincipalPrivilegeSet get_table_privilege_set (1: string db_name, 2: string table_name, 3: string user_name, 4: list group_names) + throws(1:MetaException o1) + PrincipalPrivilegeSet get_partition_privilege_set (1: string db_name, 2: string table_name, 3: string part_name, 4: string user_name, 5: list group_names) + throws(1:MetaException o1) + PrincipalPrivilegeSet get_column_privilege_set (1: string db_name, 2: string table_name, 3: string part_name, 4: string column_name, 5: string user_name, 6: list group_names) + throws(1:MetaException o1) + bool create_role(1: string role_name, 2: string owner_name) throws(1:MetaException o1) + + bool drop_role(1: string role_name) throws(1:MetaException o1) + + bool add_role_member (1: string role_name, 2: string user_name, 3: bool is_role, 4: bool is_group) throws(1:MetaException o1) + + bool remove_role_member (1: string role_name, 2: string user_name, 3: bool is_role, 4: bool is_group) throws(1:MetaException o1) + + list list_security_user_grant(1: string principla_name, 2: bool is_role, 3: bool is_group) throws(1:MetaException o1) + + list list_security_db_grant(1: string principal_name, 2: bool is_group, 3: bool is_role, 4: string db_name) throws(1:MetaException o1) + + list list_security_table_grant(1: string principal_name, 2: bool is_group, 3: bool is_role, 4: string db_name, 5: string table_name) throws(1:MetaException o1) + + list list_security_partition_grant(1: string principal_name, 2: bool is_group, 3: bool is_role, 4: string db_name, 5: string table_name, 6: string part_name) throws(1:MetaException o1) + + list list_security_column_grant(1: string principal_name, 2: bool is_group, 3: bool is_role, 4: string db_name, 5: string table_name, 6: string column_name) throws(1:MetaException o1) + + bool grant_privileges (1: string user_name, 2: bool is_role, 3: bool is_group, 4: PrivilegeBag privileges, 5: string grantor) throws(1:MetaException o1) + + bool revoke_privileges (1: string user_name, 2: bool is_role, 3: bool is_group, 4: PrivilegeBag privileges) throws(1:MetaException o1) + + bool revoke_all_privileges (1: string user_name, 2: bool is_role, 3: bool is_group, 4: bool remove_user_priv, 5: list dbs, + 6: list tables, 7: list parts, 8: map> columns) throws(1:MetaException o1) } // For storing info about archived partitions in parameters Index: metastore/src/gen-javabean/org/apache/hadoop/hive/metastore/api/ColumnPrivilegeBag.java =================================================================== --- metastore/src/gen-javabean/org/apache/hadoop/hive/metastore/api/ColumnPrivilegeBag.java (revision 0) +++ metastore/src/gen-javabean/org/apache/hadoop/hive/metastore/api/ColumnPrivilegeBag.java (revision 0) @@ -0,0 +1,393 @@ +/** + * Autogenerated by Thrift + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + */ +package org.apache.hadoop.hive.metastore.api; + +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.Set; +import java.util.HashSet; +import java.util.Collections; +import org.apache.log4j.Logger; + +import org.apache.thrift.*; +import org.apache.thrift.meta_data.*; +import org.apache.thrift.protocol.*; + +public class ColumnPrivilegeBag implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("ColumnPrivilegeBag"); + private static final TField DB_NAME_FIELD_DESC = new TField("dbName", TType.STRING, (short)1); + private static final TField TABLE_NAME_FIELD_DESC = new TField("tableName", TType.STRING, (short)2); + private static final TField COLUMN_PRIVILEGES_FIELD_DESC = new TField("columnPrivileges", TType.MAP, (short)3); + + private String dbName; + public static final int DBNAME = 1; + private String tableName; + public static final int TABLENAME = 2; + private Map columnPrivileges; + public static final int COLUMNPRIVILEGES = 3; + + private final Isset __isset = new Isset(); + private static final class Isset implements java.io.Serializable { + } + + public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ + put(DBNAME, new FieldMetaData("dbName", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + put(TABLENAME, new FieldMetaData("tableName", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + put(COLUMNPRIVILEGES, new FieldMetaData("columnPrivileges", TFieldRequirementType.DEFAULT, + new MapMetaData(TType.MAP, + new FieldValueMetaData(TType.STRING), + new FieldValueMetaData(TType.STRING)))); + }}); + + static { + FieldMetaData.addStructMetaDataMap(ColumnPrivilegeBag.class, metaDataMap); + } + + public ColumnPrivilegeBag() { + } + + public ColumnPrivilegeBag( + String dbName, + String tableName, + Map columnPrivileges) + { + this(); + this.dbName = dbName; + this.tableName = tableName; + this.columnPrivileges = columnPrivileges; + } + + /** + * Performs a deep copy on other. + */ + public ColumnPrivilegeBag(ColumnPrivilegeBag other) { + if (other.isSetDbName()) { + this.dbName = other.dbName; + } + if (other.isSetTableName()) { + this.tableName = other.tableName; + } + if (other.isSetColumnPrivileges()) { + Map __this__columnPrivileges = new HashMap(); + for (Map.Entry other_element : other.columnPrivileges.entrySet()) { + + String other_element_key = other_element.getKey(); + String other_element_value = other_element.getValue(); + + String __this__columnPrivileges_copy_key = other_element_key; + + String __this__columnPrivileges_copy_value = other_element_value; + + __this__columnPrivileges.put(__this__columnPrivileges_copy_key, __this__columnPrivileges_copy_value); + } + this.columnPrivileges = __this__columnPrivileges; + } + } + + @Override + public ColumnPrivilegeBag clone() { + return new ColumnPrivilegeBag(this); + } + + public String getDbName() { + return this.dbName; + } + + public void setDbName(String dbName) { + this.dbName = dbName; + } + + public void unsetDbName() { + this.dbName = null; + } + + // Returns true if field dbName is set (has been asigned a value) and false otherwise + public boolean isSetDbName() { + return this.dbName != null; + } + + public String getTableName() { + return this.tableName; + } + + public void setTableName(String tableName) { + this.tableName = tableName; + } + + public void unsetTableName() { + this.tableName = null; + } + + // Returns true if field tableName is set (has been asigned a value) and false otherwise + public boolean isSetTableName() { + return this.tableName != null; + } + + public int getColumnPrivilegesSize() { + return (this.columnPrivileges == null) ? 0 : this.columnPrivileges.size(); + } + + public void putToColumnPrivileges(String key, String val) { + if (this.columnPrivileges == null) { + this.columnPrivileges = new HashMap(); + } + this.columnPrivileges.put(key, val); + } + + public Map getColumnPrivileges() { + return this.columnPrivileges; + } + + public void setColumnPrivileges(Map columnPrivileges) { + this.columnPrivileges = columnPrivileges; + } + + public void unsetColumnPrivileges() { + this.columnPrivileges = null; + } + + // Returns true if field columnPrivileges is set (has been asigned a value) and false otherwise + public boolean isSetColumnPrivileges() { + return this.columnPrivileges != null; + } + + public void setFieldValue(int fieldID, Object value) { + switch (fieldID) { + case DBNAME: + if (value == null) { + unsetDbName(); + } else { + setDbName((String)value); + } + break; + + case TABLENAME: + if (value == null) { + unsetTableName(); + } else { + setTableName((String)value); + } + break; + + case COLUMNPRIVILEGES: + if (value == null) { + unsetColumnPrivileges(); + } else { + setColumnPrivileges((Map)value); + } + break; + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + public Object getFieldValue(int fieldID) { + switch (fieldID) { + case DBNAME: + return getDbName(); + + case TABLENAME: + return getTableName(); + + case COLUMNPRIVILEGES: + return getColumnPrivileges(); + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise + public boolean isSet(int fieldID) { + switch (fieldID) { + case DBNAME: + return isSetDbName(); + case TABLENAME: + return isSetTableName(); + case COLUMNPRIVILEGES: + return isSetColumnPrivileges(); + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof ColumnPrivilegeBag) + return this.equals((ColumnPrivilegeBag)that); + return false; + } + + public boolean equals(ColumnPrivilegeBag that) { + if (that == null) + return false; + + boolean this_present_dbName = true && this.isSetDbName(); + boolean that_present_dbName = true && that.isSetDbName(); + if (this_present_dbName || that_present_dbName) { + if (!(this_present_dbName && that_present_dbName)) + return false; + if (!this.dbName.equals(that.dbName)) + return false; + } + + boolean this_present_tableName = true && this.isSetTableName(); + boolean that_present_tableName = true && that.isSetTableName(); + if (this_present_tableName || that_present_tableName) { + if (!(this_present_tableName && that_present_tableName)) + return false; + if (!this.tableName.equals(that.tableName)) + return false; + } + + boolean this_present_columnPrivileges = true && this.isSetColumnPrivileges(); + boolean that_present_columnPrivileges = true && that.isSetColumnPrivileges(); + if (this_present_columnPrivileges || that_present_columnPrivileges) { + if (!(this_present_columnPrivileges && that_present_columnPrivileges)) + return false; + if (!this.columnPrivileges.equals(that.columnPrivileges)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + public void read(TProtocol iprot) throws TException { + TField field; + iprot.readStructBegin(); + while (true) + { + field = iprot.readFieldBegin(); + if (field.type == TType.STOP) { + break; + } + switch (field.id) + { + case DBNAME: + if (field.type == TType.STRING) { + this.dbName = iprot.readString(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case TABLENAME: + if (field.type == TType.STRING) { + this.tableName = iprot.readString(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case COLUMNPRIVILEGES: + if (field.type == TType.MAP) { + { + TMap _map73 = iprot.readMapBegin(); + this.columnPrivileges = new HashMap(2*_map73.size); + for (int _i74 = 0; _i74 < _map73.size; ++_i74) + { + String _key75; + String _val76; + _key75 = iprot.readString(); + _val76 = iprot.readString(); + this.columnPrivileges.put(_key75, _val76); + } + iprot.readMapEnd(); + } + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); + break; + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + validate(); + } + + public void write(TProtocol oprot) throws TException { + validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (this.dbName != null) { + oprot.writeFieldBegin(DB_NAME_FIELD_DESC); + oprot.writeString(this.dbName); + oprot.writeFieldEnd(); + } + if (this.tableName != null) { + oprot.writeFieldBegin(TABLE_NAME_FIELD_DESC); + oprot.writeString(this.tableName); + oprot.writeFieldEnd(); + } + if (this.columnPrivileges != null) { + oprot.writeFieldBegin(COLUMN_PRIVILEGES_FIELD_DESC); + { + oprot.writeMapBegin(new TMap(TType.STRING, TType.STRING, this.columnPrivileges.size())); + for (Map.Entry _iter77 : this.columnPrivileges.entrySet()) { + oprot.writeString(_iter77.getKey()); + oprot.writeString(_iter77.getValue()); + } + oprot.writeMapEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("ColumnPrivilegeBag("); + boolean first = true; + + sb.append("dbName:"); + if (this.dbName == null) { + sb.append("null"); + } else { + sb.append(this.dbName); + } + first = false; + if (!first) sb.append(", "); + sb.append("tableName:"); + if (this.tableName == null) { + sb.append("null"); + } else { + sb.append(this.tableName); + } + first = false; + if (!first) sb.append(", "); + sb.append("columnPrivileges:"); + if (this.columnPrivileges == null) { + sb.append("null"); + } else { + sb.append(this.columnPrivileges); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws TException { + // check for required fields + // check that fields of type enum have valid values + } + +} + Index: metastore/src/gen-javabean/org/apache/hadoop/hive/metastore/api/Database.java =================================================================== --- metastore/src/gen-javabean/org/apache/hadoop/hive/metastore/api/Database.java (revision 1030336) +++ metastore/src/gen-javabean/org/apache/hadoop/hive/metastore/api/Database.java (working copy) @@ -23,6 +23,7 @@ private static final TField NAME_FIELD_DESC = new TField("name", TType.STRING, (short)1); private static final TField DESCRIPTION_FIELD_DESC = new TField("description", TType.STRING, (short)2); private static final TField LOCATION_URI_FIELD_DESC = new TField("locationUri", TType.STRING, (short)3); + private static final TField PRIVILEGES_FIELD_DESC = new TField("privileges", TType.STRUCT, (short)4); private String name; public static final int NAME = 1; @@ -30,6 +31,8 @@ public static final int DESCRIPTION = 2; private String locationUri; public static final int LOCATIONURI = 3; + private PrincipalPrivilegeSet privileges; + public static final int PRIVILEGES = 4; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { @@ -42,6 +45,8 @@ new FieldValueMetaData(TType.STRING))); put(LOCATIONURI, new FieldMetaData("locationUri", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRING))); + put(PRIVILEGES, new FieldMetaData("privileges", TFieldRequirementType.OPTIONAL, + new StructMetaData(TType.STRUCT, PrincipalPrivilegeSet.class))); }}); static { @@ -54,12 +59,14 @@ public Database( String name, String description, - String locationUri) + String locationUri, + PrincipalPrivilegeSet privileges) { this(); this.name = name; this.description = description; this.locationUri = locationUri; + this.privileges = privileges; } /** @@ -75,6 +82,9 @@ if (other.isSetLocationUri()) { this.locationUri = other.locationUri; } + if (other.isSetPrivileges()) { + this.privileges = new PrincipalPrivilegeSet(other.privileges); + } } @Override @@ -133,6 +143,23 @@ return this.locationUri != null; } + public PrincipalPrivilegeSet getPrivileges() { + return this.privileges; + } + + public void setPrivileges(PrincipalPrivilegeSet privileges) { + this.privileges = privileges; + } + + public void unsetPrivileges() { + this.privileges = null; + } + + // Returns true if field privileges is set (has been asigned a value) and false otherwise + public boolean isSetPrivileges() { + return this.privileges != null; + } + public void setFieldValue(int fieldID, Object value) { switch (fieldID) { case NAME: @@ -159,6 +186,14 @@ } break; + case PRIVILEGES: + if (value == null) { + unsetPrivileges(); + } else { + setPrivileges((PrincipalPrivilegeSet)value); + } + break; + default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -175,6 +210,9 @@ case LOCATIONURI: return getLocationUri(); + case PRIVILEGES: + return getPrivileges(); + default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -189,6 +227,8 @@ return isSetDescription(); case LOCATIONURI: return isSetLocationUri(); + case PRIVILEGES: + return isSetPrivileges(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -234,6 +274,15 @@ return false; } + boolean this_present_privileges = true && this.isSetPrivileges(); + boolean that_present_privileges = true && that.isSetPrivileges(); + if (this_present_privileges || that_present_privileges) { + if (!(this_present_privileges && that_present_privileges)) + return false; + if (!this.privileges.equals(that.privileges)) + return false; + } + return true; } @@ -274,6 +323,14 @@ TProtocolUtil.skip(iprot, field.type); } break; + case PRIVILEGES: + if (field.type == TType.STRUCT) { + this.privileges = new PrincipalPrivilegeSet(); + this.privileges.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; default: TProtocolUtil.skip(iprot, field.type); break; @@ -304,6 +361,13 @@ oprot.writeString(this.locationUri); oprot.writeFieldEnd(); } + if (this.privileges != null) { + if (isSetPrivileges()) { + oprot.writeFieldBegin(PRIVILEGES_FIELD_DESC); + this.privileges.write(oprot); + oprot.writeFieldEnd(); + } + } oprot.writeFieldStop(); oprot.writeStructEnd(); } @@ -336,6 +400,16 @@ sb.append(this.locationUri); } first = false; + if (isSetPrivileges()) { + if (!first) sb.append(", "); + sb.append("privileges:"); + if (this.privileges == null) { + sb.append("null"); + } else { + sb.append(this.privileges); + } + first = false; + } sb.append(")"); return sb.toString(); } Index: metastore/src/gen-javabean/org/apache/hadoop/hive/metastore/api/Index.java =================================================================== --- metastore/src/gen-javabean/org/apache/hadoop/hive/metastore/api/Index.java (revision 1030336) +++ metastore/src/gen-javabean/org/apache/hadoop/hive/metastore/api/Index.java (working copy) @@ -689,15 +689,15 @@ case PARAMETERS: if (field.type == TType.MAP) { { - TMap _map44 = iprot.readMapBegin(); - this.parameters = new HashMap(2*_map44.size); - for (int _i45 = 0; _i45 < _map44.size; ++_i45) + TMap _map59 = iprot.readMapBegin(); + this.parameters = new HashMap(2*_map59.size); + for (int _i60 = 0; _i60 < _map59.size; ++_i60) { - String _key46; - String _val47; - _key46 = iprot.readString(); - _val47 = iprot.readString(); - this.parameters.put(_key46, _val47); + String _key61; + String _val62; + _key61 = iprot.readString(); + _val62 = iprot.readString(); + this.parameters.put(_key61, _val62); } iprot.readMapEnd(); } @@ -768,9 +768,9 @@ oprot.writeFieldBegin(PARAMETERS_FIELD_DESC); { oprot.writeMapBegin(new TMap(TType.STRING, TType.STRING, this.parameters.size())); - for (Map.Entry _iter48 : this.parameters.entrySet()) { - oprot.writeString(_iter48.getKey()); - oprot.writeString(_iter48.getValue()); + for (Map.Entry _iter63 : this.parameters.entrySet()) { + oprot.writeString(_iter63.getKey()); + oprot.writeString(_iter63.getValue()); } oprot.writeMapEnd(); } Index: metastore/src/gen-javabean/org/apache/hadoop/hive/metastore/api/Partition.java =================================================================== --- metastore/src/gen-javabean/org/apache/hadoop/hive/metastore/api/Partition.java (revision 1030336) +++ metastore/src/gen-javabean/org/apache/hadoop/hive/metastore/api/Partition.java (working copy) @@ -27,6 +27,7 @@ private static final TField LAST_ACCESS_TIME_FIELD_DESC = new TField("lastAccessTime", TType.I32, (short)5); private static final TField SD_FIELD_DESC = new TField("sd", TType.STRUCT, (short)6); private static final TField PARAMETERS_FIELD_DESC = new TField("parameters", TType.MAP, (short)7); + private static final TField PRIVILEGES_FIELD_DESC = new TField("privileges", TType.STRUCT, (short)8); private List values; public static final int VALUES = 1; @@ -42,6 +43,8 @@ public static final int SD = 6; private Map parameters; public static final int PARAMETERS = 7; + private PrincipalPrivilegeSet privileges; + public static final int PRIVILEGES = 8; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { @@ -67,6 +70,8 @@ new MapMetaData(TType.MAP, new FieldValueMetaData(TType.STRING), new FieldValueMetaData(TType.STRING)))); + put(PRIVILEGES, new FieldMetaData("privileges", TFieldRequirementType.OPTIONAL, + new StructMetaData(TType.STRUCT, PrincipalPrivilegeSet.class))); }}); static { @@ -83,7 +88,8 @@ int createTime, int lastAccessTime, StorageDescriptor sd, - Map parameters) + Map parameters, + PrincipalPrivilegeSet privileges) { this(); this.values = values; @@ -95,6 +101,7 @@ this.__isset.lastAccessTime = true; this.sd = sd; this.parameters = parameters; + this.privileges = privileges; } /** @@ -136,6 +143,9 @@ } this.parameters = __this__parameters; } + if (other.isSetPrivileges()) { + this.privileges = new PrincipalPrivilegeSet(other.privileges); + } } @Override @@ -290,6 +300,23 @@ return this.parameters != null; } + public PrincipalPrivilegeSet getPrivileges() { + return this.privileges; + } + + public void setPrivileges(PrincipalPrivilegeSet privileges) { + this.privileges = privileges; + } + + public void unsetPrivileges() { + this.privileges = null; + } + + // Returns true if field privileges is set (has been asigned a value) and false otherwise + public boolean isSetPrivileges() { + return this.privileges != null; + } + public void setFieldValue(int fieldID, Object value) { switch (fieldID) { case VALUES: @@ -348,6 +375,14 @@ } break; + case PRIVILEGES: + if (value == null) { + unsetPrivileges(); + } else { + setPrivileges((PrincipalPrivilegeSet)value); + } + break; + default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -376,6 +411,9 @@ case PARAMETERS: return getParameters(); + case PRIVILEGES: + return getPrivileges(); + default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -398,6 +436,8 @@ return isSetSd(); case PARAMETERS: return isSetParameters(); + case PRIVILEGES: + return isSetPrivileges(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -479,6 +519,15 @@ return false; } + boolean this_present_privileges = true && this.isSetPrivileges(); + boolean that_present_privileges = true && that.isSetPrivileges(); + if (this_present_privileges || that_present_privileges) { + if (!(this_present_privileges && that_present_privileges)) + return false; + if (!this.privileges.equals(that.privileges)) + return false; + } + return true; } @@ -501,13 +550,13 @@ case VALUES: if (field.type == TType.LIST) { { - TList _list35 = iprot.readListBegin(); - this.values = new ArrayList(_list35.size); - for (int _i36 = 0; _i36 < _list35.size; ++_i36) + TList _list50 = iprot.readListBegin(); + this.values = new ArrayList(_list50.size); + for (int _i51 = 0; _i51 < _list50.size; ++_i51) { - String _elem37; - _elem37 = iprot.readString(); - this.values.add(_elem37); + String _elem52; + _elem52 = iprot.readString(); + this.values.add(_elem52); } iprot.readListEnd(); } @@ -556,15 +605,15 @@ case PARAMETERS: if (field.type == TType.MAP) { { - TMap _map38 = iprot.readMapBegin(); - this.parameters = new HashMap(2*_map38.size); - for (int _i39 = 0; _i39 < _map38.size; ++_i39) + TMap _map53 = iprot.readMapBegin(); + this.parameters = new HashMap(2*_map53.size); + for (int _i54 = 0; _i54 < _map53.size; ++_i54) { - String _key40; - String _val41; - _key40 = iprot.readString(); - _val41 = iprot.readString(); - this.parameters.put(_key40, _val41); + String _key55; + String _val56; + _key55 = iprot.readString(); + _val56 = iprot.readString(); + this.parameters.put(_key55, _val56); } iprot.readMapEnd(); } @@ -572,6 +621,14 @@ TProtocolUtil.skip(iprot, field.type); } break; + case PRIVILEGES: + if (field.type == TType.STRUCT) { + this.privileges = new PrincipalPrivilegeSet(); + this.privileges.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; default: TProtocolUtil.skip(iprot, field.type); break; @@ -591,8 +648,8 @@ oprot.writeFieldBegin(VALUES_FIELD_DESC); { oprot.writeListBegin(new TList(TType.STRING, this.values.size())); - for (String _iter42 : this.values) { - oprot.writeString(_iter42); + for (String _iter57 : this.values) { + oprot.writeString(_iter57); } oprot.writeListEnd(); } @@ -623,14 +680,21 @@ oprot.writeFieldBegin(PARAMETERS_FIELD_DESC); { oprot.writeMapBegin(new TMap(TType.STRING, TType.STRING, this.parameters.size())); - for (Map.Entry _iter43 : this.parameters.entrySet()) { - oprot.writeString(_iter43.getKey()); - oprot.writeString(_iter43.getValue()); + for (Map.Entry _iter58 : this.parameters.entrySet()) { + oprot.writeString(_iter58.getKey()); + oprot.writeString(_iter58.getValue()); } oprot.writeMapEnd(); } oprot.writeFieldEnd(); } + if (this.privileges != null) { + if (isSetPrivileges()) { + oprot.writeFieldBegin(PRIVILEGES_FIELD_DESC); + this.privileges.write(oprot); + oprot.writeFieldEnd(); + } + } oprot.writeFieldStop(); oprot.writeStructEnd(); } @@ -687,6 +751,16 @@ sb.append(this.parameters); } first = false; + if (isSetPrivileges()) { + if (!first) sb.append(", "); + sb.append("privileges:"); + if (this.privileges == null) { + sb.append("null"); + } else { + sb.append(this.privileges); + } + first = false; + } sb.append(")"); return sb.toString(); } Index: metastore/src/gen-javabean/org/apache/hadoop/hive/metastore/api/PrincipalPrivilegeSet.java =================================================================== --- metastore/src/gen-javabean/org/apache/hadoop/hive/metastore/api/PrincipalPrivilegeSet.java (revision 0) +++ metastore/src/gen-javabean/org/apache/hadoop/hive/metastore/api/PrincipalPrivilegeSet.java (revision 0) @@ -0,0 +1,481 @@ +/** + * Autogenerated by Thrift + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + */ +package org.apache.hadoop.hive.metastore.api; + +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.Set; +import java.util.HashSet; +import java.util.Collections; +import org.apache.log4j.Logger; + +import org.apache.thrift.*; +import org.apache.thrift.meta_data.*; +import org.apache.thrift.protocol.*; + +public class PrincipalPrivilegeSet implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("PrincipalPrivilegeSet"); + private static final TField USER_PRIVILEGES_FIELD_DESC = new TField("userPrivileges", TType.MAP, (short)1); + private static final TField GROUP_PRIVILEGES_FIELD_DESC = new TField("groupPrivileges", TType.MAP, (short)2); + private static final TField ROLE_PRIVILEGES_FIELD_DESC = new TField("rolePrivileges", TType.MAP, (short)3); + + private Map userPrivileges; + public static final int USERPRIVILEGES = 1; + private Map groupPrivileges; + public static final int GROUPPRIVILEGES = 2; + private Map rolePrivileges; + public static final int ROLEPRIVILEGES = 3; + + private final Isset __isset = new Isset(); + private static final class Isset implements java.io.Serializable { + } + + public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ + put(USERPRIVILEGES, new FieldMetaData("userPrivileges", TFieldRequirementType.DEFAULT, + new MapMetaData(TType.MAP, + new FieldValueMetaData(TType.STRING), + new FieldValueMetaData(TType.STRING)))); + put(GROUPPRIVILEGES, new FieldMetaData("groupPrivileges", TFieldRequirementType.DEFAULT, + new MapMetaData(TType.MAP, + new FieldValueMetaData(TType.STRING), + new FieldValueMetaData(TType.STRING)))); + put(ROLEPRIVILEGES, new FieldMetaData("rolePrivileges", TFieldRequirementType.DEFAULT, + new MapMetaData(TType.MAP, + new FieldValueMetaData(TType.STRING), + new FieldValueMetaData(TType.STRING)))); + }}); + + static { + FieldMetaData.addStructMetaDataMap(PrincipalPrivilegeSet.class, metaDataMap); + } + + public PrincipalPrivilegeSet() { + } + + public PrincipalPrivilegeSet( + Map userPrivileges, + Map groupPrivileges, + Map rolePrivileges) + { + this(); + this.userPrivileges = userPrivileges; + this.groupPrivileges = groupPrivileges; + this.rolePrivileges = rolePrivileges; + } + + /** + * Performs a deep copy on other. + */ + public PrincipalPrivilegeSet(PrincipalPrivilegeSet other) { + if (other.isSetUserPrivileges()) { + Map __this__userPrivileges = new HashMap(); + for (Map.Entry other_element : other.userPrivileges.entrySet()) { + + String other_element_key = other_element.getKey(); + String other_element_value = other_element.getValue(); + + String __this__userPrivileges_copy_key = other_element_key; + + String __this__userPrivileges_copy_value = other_element_value; + + __this__userPrivileges.put(__this__userPrivileges_copy_key, __this__userPrivileges_copy_value); + } + this.userPrivileges = __this__userPrivileges; + } + if (other.isSetGroupPrivileges()) { + Map __this__groupPrivileges = new HashMap(); + for (Map.Entry other_element : other.groupPrivileges.entrySet()) { + + String other_element_key = other_element.getKey(); + String other_element_value = other_element.getValue(); + + String __this__groupPrivileges_copy_key = other_element_key; + + String __this__groupPrivileges_copy_value = other_element_value; + + __this__groupPrivileges.put(__this__groupPrivileges_copy_key, __this__groupPrivileges_copy_value); + } + this.groupPrivileges = __this__groupPrivileges; + } + if (other.isSetRolePrivileges()) { + Map __this__rolePrivileges = new HashMap(); + for (Map.Entry other_element : other.rolePrivileges.entrySet()) { + + String other_element_key = other_element.getKey(); + String other_element_value = other_element.getValue(); + + String __this__rolePrivileges_copy_key = other_element_key; + + String __this__rolePrivileges_copy_value = other_element_value; + + __this__rolePrivileges.put(__this__rolePrivileges_copy_key, __this__rolePrivileges_copy_value); + } + this.rolePrivileges = __this__rolePrivileges; + } + } + + @Override + public PrincipalPrivilegeSet clone() { + return new PrincipalPrivilegeSet(this); + } + + public int getUserPrivilegesSize() { + return (this.userPrivileges == null) ? 0 : this.userPrivileges.size(); + } + + public void putToUserPrivileges(String key, String val) { + if (this.userPrivileges == null) { + this.userPrivileges = new HashMap(); + } + this.userPrivileges.put(key, val); + } + + public Map getUserPrivileges() { + return this.userPrivileges; + } + + public void setUserPrivileges(Map userPrivileges) { + this.userPrivileges = userPrivileges; + } + + public void unsetUserPrivileges() { + this.userPrivileges = null; + } + + // Returns true if field userPrivileges is set (has been asigned a value) and false otherwise + public boolean isSetUserPrivileges() { + return this.userPrivileges != null; + } + + public int getGroupPrivilegesSize() { + return (this.groupPrivileges == null) ? 0 : this.groupPrivileges.size(); + } + + public void putToGroupPrivileges(String key, String val) { + if (this.groupPrivileges == null) { + this.groupPrivileges = new HashMap(); + } + this.groupPrivileges.put(key, val); + } + + public Map getGroupPrivileges() { + return this.groupPrivileges; + } + + public void setGroupPrivileges(Map groupPrivileges) { + this.groupPrivileges = groupPrivileges; + } + + public void unsetGroupPrivileges() { + this.groupPrivileges = null; + } + + // Returns true if field groupPrivileges is set (has been asigned a value) and false otherwise + public boolean isSetGroupPrivileges() { + return this.groupPrivileges != null; + } + + public int getRolePrivilegesSize() { + return (this.rolePrivileges == null) ? 0 : this.rolePrivileges.size(); + } + + public void putToRolePrivileges(String key, String val) { + if (this.rolePrivileges == null) { + this.rolePrivileges = new HashMap(); + } + this.rolePrivileges.put(key, val); + } + + public Map getRolePrivileges() { + return this.rolePrivileges; + } + + public void setRolePrivileges(Map rolePrivileges) { + this.rolePrivileges = rolePrivileges; + } + + public void unsetRolePrivileges() { + this.rolePrivileges = null; + } + + // Returns true if field rolePrivileges is set (has been asigned a value) and false otherwise + public boolean isSetRolePrivileges() { + return this.rolePrivileges != null; + } + + public void setFieldValue(int fieldID, Object value) { + switch (fieldID) { + case USERPRIVILEGES: + if (value == null) { + unsetUserPrivileges(); + } else { + setUserPrivileges((Map)value); + } + break; + + case GROUPPRIVILEGES: + if (value == null) { + unsetGroupPrivileges(); + } else { + setGroupPrivileges((Map)value); + } + break; + + case ROLEPRIVILEGES: + if (value == null) { + unsetRolePrivileges(); + } else { + setRolePrivileges((Map)value); + } + break; + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + public Object getFieldValue(int fieldID) { + switch (fieldID) { + case USERPRIVILEGES: + return getUserPrivileges(); + + case GROUPPRIVILEGES: + return getGroupPrivileges(); + + case ROLEPRIVILEGES: + return getRolePrivileges(); + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise + public boolean isSet(int fieldID) { + switch (fieldID) { + case USERPRIVILEGES: + return isSetUserPrivileges(); + case GROUPPRIVILEGES: + return isSetGroupPrivileges(); + case ROLEPRIVILEGES: + return isSetRolePrivileges(); + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof PrincipalPrivilegeSet) + return this.equals((PrincipalPrivilegeSet)that); + return false; + } + + public boolean equals(PrincipalPrivilegeSet that) { + if (that == null) + return false; + + boolean this_present_userPrivileges = true && this.isSetUserPrivileges(); + boolean that_present_userPrivileges = true && that.isSetUserPrivileges(); + if (this_present_userPrivileges || that_present_userPrivileges) { + if (!(this_present_userPrivileges && that_present_userPrivileges)) + return false; + if (!this.userPrivileges.equals(that.userPrivileges)) + return false; + } + + boolean this_present_groupPrivileges = true && this.isSetGroupPrivileges(); + boolean that_present_groupPrivileges = true && that.isSetGroupPrivileges(); + if (this_present_groupPrivileges || that_present_groupPrivileges) { + if (!(this_present_groupPrivileges && that_present_groupPrivileges)) + return false; + if (!this.groupPrivileges.equals(that.groupPrivileges)) + return false; + } + + boolean this_present_rolePrivileges = true && this.isSetRolePrivileges(); + boolean that_present_rolePrivileges = true && that.isSetRolePrivileges(); + if (this_present_rolePrivileges || that_present_rolePrivileges) { + if (!(this_present_rolePrivileges && that_present_rolePrivileges)) + return false; + if (!this.rolePrivileges.equals(that.rolePrivileges)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + public void read(TProtocol iprot) throws TException { + TField field; + iprot.readStructBegin(); + while (true) + { + field = iprot.readFieldBegin(); + if (field.type == TType.STOP) { + break; + } + switch (field.id) + { + case USERPRIVILEGES: + if (field.type == TType.MAP) { + { + TMap _map4 = iprot.readMapBegin(); + this.userPrivileges = new HashMap(2*_map4.size); + for (int _i5 = 0; _i5 < _map4.size; ++_i5) + { + String _key6; + String _val7; + _key6 = iprot.readString(); + _val7 = iprot.readString(); + this.userPrivileges.put(_key6, _val7); + } + iprot.readMapEnd(); + } + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case GROUPPRIVILEGES: + if (field.type == TType.MAP) { + { + TMap _map8 = iprot.readMapBegin(); + this.groupPrivileges = new HashMap(2*_map8.size); + for (int _i9 = 0; _i9 < _map8.size; ++_i9) + { + String _key10; + String _val11; + _key10 = iprot.readString(); + _val11 = iprot.readString(); + this.groupPrivileges.put(_key10, _val11); + } + iprot.readMapEnd(); + } + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case ROLEPRIVILEGES: + if (field.type == TType.MAP) { + { + TMap _map12 = iprot.readMapBegin(); + this.rolePrivileges = new HashMap(2*_map12.size); + for (int _i13 = 0; _i13 < _map12.size; ++_i13) + { + String _key14; + String _val15; + _key14 = iprot.readString(); + _val15 = iprot.readString(); + this.rolePrivileges.put(_key14, _val15); + } + iprot.readMapEnd(); + } + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); + break; + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + validate(); + } + + public void write(TProtocol oprot) throws TException { + validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (this.userPrivileges != null) { + oprot.writeFieldBegin(USER_PRIVILEGES_FIELD_DESC); + { + oprot.writeMapBegin(new TMap(TType.STRING, TType.STRING, this.userPrivileges.size())); + for (Map.Entry _iter16 : this.userPrivileges.entrySet()) { + oprot.writeString(_iter16.getKey()); + oprot.writeString(_iter16.getValue()); + } + oprot.writeMapEnd(); + } + oprot.writeFieldEnd(); + } + if (this.groupPrivileges != null) { + oprot.writeFieldBegin(GROUP_PRIVILEGES_FIELD_DESC); + { + oprot.writeMapBegin(new TMap(TType.STRING, TType.STRING, this.groupPrivileges.size())); + for (Map.Entry _iter17 : this.groupPrivileges.entrySet()) { + oprot.writeString(_iter17.getKey()); + oprot.writeString(_iter17.getValue()); + } + oprot.writeMapEnd(); + } + oprot.writeFieldEnd(); + } + if (this.rolePrivileges != null) { + oprot.writeFieldBegin(ROLE_PRIVILEGES_FIELD_DESC); + { + oprot.writeMapBegin(new TMap(TType.STRING, TType.STRING, this.rolePrivileges.size())); + for (Map.Entry _iter18 : this.rolePrivileges.entrySet()) { + oprot.writeString(_iter18.getKey()); + oprot.writeString(_iter18.getValue()); + } + oprot.writeMapEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("PrincipalPrivilegeSet("); + boolean first = true; + + sb.append("userPrivileges:"); + if (this.userPrivileges == null) { + sb.append("null"); + } else { + sb.append(this.userPrivileges); + } + first = false; + if (!first) sb.append(", "); + sb.append("groupPrivileges:"); + if (this.groupPrivileges == null) { + sb.append("null"); + } else { + sb.append(this.groupPrivileges); + } + first = false; + if (!first) sb.append(", "); + sb.append("rolePrivileges:"); + if (this.rolePrivileges == null) { + sb.append("null"); + } else { + sb.append(this.rolePrivileges); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws TException { + // check for required fields + // check that fields of type enum have valid values + } + +} + Index: metastore/src/gen-javabean/org/apache/hadoop/hive/metastore/api/PrivilegeBag.java =================================================================== --- metastore/src/gen-javabean/org/apache/hadoop/hive/metastore/api/PrivilegeBag.java (revision 0) +++ metastore/src/gen-javabean/org/apache/hadoop/hive/metastore/api/PrivilegeBag.java (revision 0) @@ -0,0 +1,659 @@ +/** + * Autogenerated by Thrift + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + */ +package org.apache.hadoop.hive.metastore.api; + +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.Set; +import java.util.HashSet; +import java.util.Collections; +import org.apache.log4j.Logger; + +import org.apache.thrift.*; +import org.apache.thrift.meta_data.*; +import org.apache.thrift.protocol.*; + +public class PrivilegeBag implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("PrivilegeBag"); + private static final TField USER_PRIVILEGES_FIELD_DESC = new TField("userPrivileges", TType.STRING, (short)1); + private static final TField DB_PRIVILEGES_FIELD_DESC = new TField("dbPrivileges", TType.MAP, (short)2); + private static final TField TABLE_PRIVILEGES_FIELD_DESC = new TField("tablePrivileges", TType.MAP, (short)3); + private static final TField PARTITION_PRIVILEGES_FIELD_DESC = new TField("partitionPrivileges", TType.MAP, (short)4); + private static final TField COLUMN_PRIVILEGES_FIELD_DESC = new TField("columnPrivileges", TType.LIST, (short)5); + + private String userPrivileges; + public static final int USERPRIVILEGES = 1; + private Map dbPrivileges; + public static final int DBPRIVILEGES = 2; + private Map tablePrivileges; + public static final int TABLEPRIVILEGES = 3; + private Map partitionPrivileges; + public static final int PARTITIONPRIVILEGES = 4; + private List columnPrivileges; + public static final int COLUMNPRIVILEGES = 5; + + private final Isset __isset = new Isset(); + private static final class Isset implements java.io.Serializable { + } + + public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ + put(USERPRIVILEGES, new FieldMetaData("userPrivileges", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + put(DBPRIVILEGES, new FieldMetaData("dbPrivileges", TFieldRequirementType.DEFAULT, + new MapMetaData(TType.MAP, + new StructMetaData(TType.STRUCT, Database.class), + new FieldValueMetaData(TType.STRING)))); + put(TABLEPRIVILEGES, new FieldMetaData("tablePrivileges", TFieldRequirementType.DEFAULT, + new MapMetaData(TType.MAP, + new StructMetaData(TType.STRUCT, Table.class), + new FieldValueMetaData(TType.STRING)))); + put(PARTITIONPRIVILEGES, new FieldMetaData("partitionPrivileges", TFieldRequirementType.DEFAULT, + new MapMetaData(TType.MAP, + new StructMetaData(TType.STRUCT, Partition.class), + new FieldValueMetaData(TType.STRING)))); + put(COLUMNPRIVILEGES, new FieldMetaData("columnPrivileges", TFieldRequirementType.DEFAULT, + new ListMetaData(TType.LIST, + new StructMetaData(TType.STRUCT, ColumnPrivilegeBag.class)))); + }}); + + static { + FieldMetaData.addStructMetaDataMap(PrivilegeBag.class, metaDataMap); + } + + public PrivilegeBag() { + } + + public PrivilegeBag( + String userPrivileges, + Map dbPrivileges, + Map tablePrivileges, + Map partitionPrivileges, + List columnPrivileges) + { + this(); + this.userPrivileges = userPrivileges; + this.dbPrivileges = dbPrivileges; + this.tablePrivileges = tablePrivileges; + this.partitionPrivileges = partitionPrivileges; + this.columnPrivileges = columnPrivileges; + } + + /** + * Performs a deep copy on other. + */ + public PrivilegeBag(PrivilegeBag other) { + if (other.isSetUserPrivileges()) { + this.userPrivileges = other.userPrivileges; + } + if (other.isSetDbPrivileges()) { + Map __this__dbPrivileges = new HashMap(); + for (Map.Entry other_element : other.dbPrivileges.entrySet()) { + + Database other_element_key = other_element.getKey(); + String other_element_value = other_element.getValue(); + + Database __this__dbPrivileges_copy_key = new Database(other_element_key); + + String __this__dbPrivileges_copy_value = other_element_value; + + __this__dbPrivileges.put(__this__dbPrivileges_copy_key, __this__dbPrivileges_copy_value); + } + this.dbPrivileges = __this__dbPrivileges; + } + if (other.isSetTablePrivileges()) { + Map __this__tablePrivileges = new HashMap(); + for (Map.Entry other_element : other.tablePrivileges.entrySet()) { + + Table other_element_key = other_element.getKey(); + String other_element_value = other_element.getValue(); + + Table __this__tablePrivileges_copy_key = new Table(other_element_key); + + String __this__tablePrivileges_copy_value = other_element_value; + + __this__tablePrivileges.put(__this__tablePrivileges_copy_key, __this__tablePrivileges_copy_value); + } + this.tablePrivileges = __this__tablePrivileges; + } + if (other.isSetPartitionPrivileges()) { + Map __this__partitionPrivileges = new HashMap(); + for (Map.Entry other_element : other.partitionPrivileges.entrySet()) { + + Partition other_element_key = other_element.getKey(); + String other_element_value = other_element.getValue(); + + Partition __this__partitionPrivileges_copy_key = new Partition(other_element_key); + + String __this__partitionPrivileges_copy_value = other_element_value; + + __this__partitionPrivileges.put(__this__partitionPrivileges_copy_key, __this__partitionPrivileges_copy_value); + } + this.partitionPrivileges = __this__partitionPrivileges; + } + if (other.isSetColumnPrivileges()) { + List __this__columnPrivileges = new ArrayList(); + for (ColumnPrivilegeBag other_element : other.columnPrivileges) { + __this__columnPrivileges.add(new ColumnPrivilegeBag(other_element)); + } + this.columnPrivileges = __this__columnPrivileges; + } + } + + @Override + public PrivilegeBag clone() { + return new PrivilegeBag(this); + } + + public String getUserPrivileges() { + return this.userPrivileges; + } + + public void setUserPrivileges(String userPrivileges) { + this.userPrivileges = userPrivileges; + } + + public void unsetUserPrivileges() { + this.userPrivileges = null; + } + + // Returns true if field userPrivileges is set (has been asigned a value) and false otherwise + public boolean isSetUserPrivileges() { + return this.userPrivileges != null; + } + + public int getDbPrivilegesSize() { + return (this.dbPrivileges == null) ? 0 : this.dbPrivileges.size(); + } + + public void putToDbPrivileges(Database key, String val) { + if (this.dbPrivileges == null) { + this.dbPrivileges = new HashMap(); + } + this.dbPrivileges.put(key, val); + } + + public Map getDbPrivileges() { + return this.dbPrivileges; + } + + public void setDbPrivileges(Map dbPrivileges) { + this.dbPrivileges = dbPrivileges; + } + + public void unsetDbPrivileges() { + this.dbPrivileges = null; + } + + // Returns true if field dbPrivileges is set (has been asigned a value) and false otherwise + public boolean isSetDbPrivileges() { + return this.dbPrivileges != null; + } + + public int getTablePrivilegesSize() { + return (this.tablePrivileges == null) ? 0 : this.tablePrivileges.size(); + } + + public void putToTablePrivileges(Table key, String val) { + if (this.tablePrivileges == null) { + this.tablePrivileges = new HashMap(); + } + this.tablePrivileges.put(key, val); + } + + public Map getTablePrivileges() { + return this.tablePrivileges; + } + + public void setTablePrivileges(Map tablePrivileges) { + this.tablePrivileges = tablePrivileges; + } + + public void unsetTablePrivileges() { + this.tablePrivileges = null; + } + + // Returns true if field tablePrivileges is set (has been asigned a value) and false otherwise + public boolean isSetTablePrivileges() { + return this.tablePrivileges != null; + } + + public int getPartitionPrivilegesSize() { + return (this.partitionPrivileges == null) ? 0 : this.partitionPrivileges.size(); + } + + public void putToPartitionPrivileges(Partition key, String val) { + if (this.partitionPrivileges == null) { + this.partitionPrivileges = new HashMap(); + } + this.partitionPrivileges.put(key, val); + } + + public Map getPartitionPrivileges() { + return this.partitionPrivileges; + } + + public void setPartitionPrivileges(Map partitionPrivileges) { + this.partitionPrivileges = partitionPrivileges; + } + + public void unsetPartitionPrivileges() { + this.partitionPrivileges = null; + } + + // Returns true if field partitionPrivileges is set (has been asigned a value) and false otherwise + public boolean isSetPartitionPrivileges() { + return this.partitionPrivileges != null; + } + + public int getColumnPrivilegesSize() { + return (this.columnPrivileges == null) ? 0 : this.columnPrivileges.size(); + } + + public java.util.Iterator getColumnPrivilegesIterator() { + return (this.columnPrivileges == null) ? null : this.columnPrivileges.iterator(); + } + + public void addToColumnPrivileges(ColumnPrivilegeBag elem) { + if (this.columnPrivileges == null) { + this.columnPrivileges = new ArrayList(); + } + this.columnPrivileges.add(elem); + } + + public List getColumnPrivileges() { + return this.columnPrivileges; + } + + public void setColumnPrivileges(List columnPrivileges) { + this.columnPrivileges = columnPrivileges; + } + + public void unsetColumnPrivileges() { + this.columnPrivileges = null; + } + + // Returns true if field columnPrivileges is set (has been asigned a value) and false otherwise + public boolean isSetColumnPrivileges() { + return this.columnPrivileges != null; + } + + public void setFieldValue(int fieldID, Object value) { + switch (fieldID) { + case USERPRIVILEGES: + if (value == null) { + unsetUserPrivileges(); + } else { + setUserPrivileges((String)value); + } + break; + + case DBPRIVILEGES: + if (value == null) { + unsetDbPrivileges(); + } else { + setDbPrivileges((Map)value); + } + break; + + case TABLEPRIVILEGES: + if (value == null) { + unsetTablePrivileges(); + } else { + setTablePrivileges((Map)value); + } + break; + + case PARTITIONPRIVILEGES: + if (value == null) { + unsetPartitionPrivileges(); + } else { + setPartitionPrivileges((Map)value); + } + break; + + case COLUMNPRIVILEGES: + if (value == null) { + unsetColumnPrivileges(); + } else { + setColumnPrivileges((List)value); + } + break; + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + public Object getFieldValue(int fieldID) { + switch (fieldID) { + case USERPRIVILEGES: + return getUserPrivileges(); + + case DBPRIVILEGES: + return getDbPrivileges(); + + case TABLEPRIVILEGES: + return getTablePrivileges(); + + case PARTITIONPRIVILEGES: + return getPartitionPrivileges(); + + case COLUMNPRIVILEGES: + return getColumnPrivileges(); + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise + public boolean isSet(int fieldID) { + switch (fieldID) { + case USERPRIVILEGES: + return isSetUserPrivileges(); + case DBPRIVILEGES: + return isSetDbPrivileges(); + case TABLEPRIVILEGES: + return isSetTablePrivileges(); + case PARTITIONPRIVILEGES: + return isSetPartitionPrivileges(); + case COLUMNPRIVILEGES: + return isSetColumnPrivileges(); + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof PrivilegeBag) + return this.equals((PrivilegeBag)that); + return false; + } + + public boolean equals(PrivilegeBag that) { + if (that == null) + return false; + + boolean this_present_userPrivileges = true && this.isSetUserPrivileges(); + boolean that_present_userPrivileges = true && that.isSetUserPrivileges(); + if (this_present_userPrivileges || that_present_userPrivileges) { + if (!(this_present_userPrivileges && that_present_userPrivileges)) + return false; + if (!this.userPrivileges.equals(that.userPrivileges)) + return false; + } + + boolean this_present_dbPrivileges = true && this.isSetDbPrivileges(); + boolean that_present_dbPrivileges = true && that.isSetDbPrivileges(); + if (this_present_dbPrivileges || that_present_dbPrivileges) { + if (!(this_present_dbPrivileges && that_present_dbPrivileges)) + return false; + if (!this.dbPrivileges.equals(that.dbPrivileges)) + return false; + } + + boolean this_present_tablePrivileges = true && this.isSetTablePrivileges(); + boolean that_present_tablePrivileges = true && that.isSetTablePrivileges(); + if (this_present_tablePrivileges || that_present_tablePrivileges) { + if (!(this_present_tablePrivileges && that_present_tablePrivileges)) + return false; + if (!this.tablePrivileges.equals(that.tablePrivileges)) + return false; + } + + boolean this_present_partitionPrivileges = true && this.isSetPartitionPrivileges(); + boolean that_present_partitionPrivileges = true && that.isSetPartitionPrivileges(); + if (this_present_partitionPrivileges || that_present_partitionPrivileges) { + if (!(this_present_partitionPrivileges && that_present_partitionPrivileges)) + return false; + if (!this.partitionPrivileges.equals(that.partitionPrivileges)) + return false; + } + + boolean this_present_columnPrivileges = true && this.isSetColumnPrivileges(); + boolean that_present_columnPrivileges = true && that.isSetColumnPrivileges(); + if (this_present_columnPrivileges || that_present_columnPrivileges) { + if (!(this_present_columnPrivileges && that_present_columnPrivileges)) + return false; + if (!this.columnPrivileges.equals(that.columnPrivileges)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + public void read(TProtocol iprot) throws TException { + TField field; + iprot.readStructBegin(); + while (true) + { + field = iprot.readFieldBegin(); + if (field.type == TType.STOP) { + break; + } + switch (field.id) + { + case USERPRIVILEGES: + if (field.type == TType.STRING) { + this.userPrivileges = iprot.readString(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case DBPRIVILEGES: + if (field.type == TType.MAP) { + { + TMap _map78 = iprot.readMapBegin(); + this.dbPrivileges = new HashMap(2*_map78.size); + for (int _i79 = 0; _i79 < _map78.size; ++_i79) + { + Database _key80; + String _val81; + _key80 = new Database(); + _key80.read(iprot); + _val81 = iprot.readString(); + this.dbPrivileges.put(_key80, _val81); + } + iprot.readMapEnd(); + } + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case TABLEPRIVILEGES: + if (field.type == TType.MAP) { + { + TMap _map82 = iprot.readMapBegin(); + this.tablePrivileges = new HashMap(2*_map82.size); + for (int _i83 = 0; _i83 < _map82.size; ++_i83) + { + Table _key84; + String _val85; + _key84 = new Table(); + _key84.read(iprot); + _val85 = iprot.readString(); + this.tablePrivileges.put(_key84, _val85); + } + iprot.readMapEnd(); + } + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case PARTITIONPRIVILEGES: + if (field.type == TType.MAP) { + { + TMap _map86 = iprot.readMapBegin(); + this.partitionPrivileges = new HashMap(2*_map86.size); + for (int _i87 = 0; _i87 < _map86.size; ++_i87) + { + Partition _key88; + String _val89; + _key88 = new Partition(); + _key88.read(iprot); + _val89 = iprot.readString(); + this.partitionPrivileges.put(_key88, _val89); + } + iprot.readMapEnd(); + } + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case COLUMNPRIVILEGES: + if (field.type == TType.LIST) { + { + TList _list90 = iprot.readListBegin(); + this.columnPrivileges = new ArrayList(_list90.size); + for (int _i91 = 0; _i91 < _list90.size; ++_i91) + { + ColumnPrivilegeBag _elem92; + _elem92 = new ColumnPrivilegeBag(); + _elem92.read(iprot); + this.columnPrivileges.add(_elem92); + } + iprot.readListEnd(); + } + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); + break; + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + validate(); + } + + public void write(TProtocol oprot) throws TException { + validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (this.userPrivileges != null) { + oprot.writeFieldBegin(USER_PRIVILEGES_FIELD_DESC); + oprot.writeString(this.userPrivileges); + oprot.writeFieldEnd(); + } + if (this.dbPrivileges != null) { + oprot.writeFieldBegin(DB_PRIVILEGES_FIELD_DESC); + { + oprot.writeMapBegin(new TMap(TType.STRUCT, TType.STRING, this.dbPrivileges.size())); + for (Map.Entry _iter93 : this.dbPrivileges.entrySet()) { + _iter93.getKey().write(oprot); + oprot.writeString(_iter93.getValue()); + } + oprot.writeMapEnd(); + } + oprot.writeFieldEnd(); + } + if (this.tablePrivileges != null) { + oprot.writeFieldBegin(TABLE_PRIVILEGES_FIELD_DESC); + { + oprot.writeMapBegin(new TMap(TType.STRUCT, TType.STRING, this.tablePrivileges.size())); + for (Map.Entry _iter94 : this.tablePrivileges.entrySet()) { + _iter94.getKey().write(oprot); + oprot.writeString(_iter94.getValue()); + } + oprot.writeMapEnd(); + } + oprot.writeFieldEnd(); + } + if (this.partitionPrivileges != null) { + oprot.writeFieldBegin(PARTITION_PRIVILEGES_FIELD_DESC); + { + oprot.writeMapBegin(new TMap(TType.STRUCT, TType.STRING, this.partitionPrivileges.size())); + for (Map.Entry _iter95 : this.partitionPrivileges.entrySet()) { + _iter95.getKey().write(oprot); + oprot.writeString(_iter95.getValue()); + } + oprot.writeMapEnd(); + } + oprot.writeFieldEnd(); + } + if (this.columnPrivileges != null) { + oprot.writeFieldBegin(COLUMN_PRIVILEGES_FIELD_DESC); + { + oprot.writeListBegin(new TList(TType.STRUCT, this.columnPrivileges.size())); + for (ColumnPrivilegeBag _iter96 : this.columnPrivileges) { + _iter96.write(oprot); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("PrivilegeBag("); + boolean first = true; + + sb.append("userPrivileges:"); + if (this.userPrivileges == null) { + sb.append("null"); + } else { + sb.append(this.userPrivileges); + } + first = false; + if (!first) sb.append(", "); + sb.append("dbPrivileges:"); + if (this.dbPrivileges == null) { + sb.append("null"); + } else { + sb.append(this.dbPrivileges); + } + first = false; + if (!first) sb.append(", "); + sb.append("tablePrivileges:"); + if (this.tablePrivileges == null) { + sb.append("null"); + } else { + sb.append(this.tablePrivileges); + } + first = false; + if (!first) sb.append(", "); + sb.append("partitionPrivileges:"); + if (this.partitionPrivileges == null) { + sb.append("null"); + } else { + sb.append(this.partitionPrivileges); + } + first = false; + if (!first) sb.append(", "); + sb.append("columnPrivileges:"); + if (this.columnPrivileges == null) { + sb.append("null"); + } else { + sb.append(this.columnPrivileges); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws TException { + // check for required fields + // check that fields of type enum have valid values + } + +} + Index: metastore/src/gen-javabean/org/apache/hadoop/hive/metastore/api/PrivilegeSet.java =================================================================== --- metastore/src/gen-javabean/org/apache/hadoop/hive/metastore/api/PrivilegeSet.java (revision 0) +++ metastore/src/gen-javabean/org/apache/hadoop/hive/metastore/api/PrivilegeSet.java (revision 0) @@ -0,0 +1,481 @@ +/** + * Autogenerated by Thrift + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + */ +package org.apache.hadoop.hive.metastore.api; + +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.Set; +import java.util.HashSet; +import java.util.Collections; +import org.apache.log4j.Logger; + +import org.apache.thrift.*; +import org.apache.thrift.meta_data.*; +import org.apache.thrift.protocol.*; + +public class PrivilegeSet implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("PrivilegeSet"); + private static final TField USER_PRIVILEGES_FIELD_DESC = new TField("user_privileges", TType.MAP, (short)1); + private static final TField GROUP_PRIVILEGES_FIELD_DESC = new TField("group_privileges", TType.MAP, (short)2); + private static final TField ROLE_PRIVILEGES_FIELD_DESC = new TField("role_privileges", TType.MAP, (short)3); + + private Map user_privileges; + public static final int USER_PRIVILEGES = 1; + private Map group_privileges; + public static final int GROUP_PRIVILEGES = 2; + private Map role_privileges; + public static final int ROLE_PRIVILEGES = 3; + + private final Isset __isset = new Isset(); + private static final class Isset implements java.io.Serializable { + } + + public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ + put(USER_PRIVILEGES, new FieldMetaData("user_privileges", TFieldRequirementType.DEFAULT, + new MapMetaData(TType.MAP, + new FieldValueMetaData(TType.STRING), + new FieldValueMetaData(TType.STRING)))); + put(GROUP_PRIVILEGES, new FieldMetaData("group_privileges", TFieldRequirementType.DEFAULT, + new MapMetaData(TType.MAP, + new FieldValueMetaData(TType.STRING), + new FieldValueMetaData(TType.STRING)))); + put(ROLE_PRIVILEGES, new FieldMetaData("role_privileges", TFieldRequirementType.DEFAULT, + new MapMetaData(TType.MAP, + new FieldValueMetaData(TType.STRING), + new FieldValueMetaData(TType.STRING)))); + }}); + + static { + FieldMetaData.addStructMetaDataMap(PrivilegeSet.class, metaDataMap); + } + + public PrivilegeSet() { + } + + public PrivilegeSet( + Map user_privileges, + Map group_privileges, + Map role_privileges) + { + this(); + this.user_privileges = user_privileges; + this.group_privileges = group_privileges; + this.role_privileges = role_privileges; + } + + /** + * Performs a deep copy on other. + */ + public PrivilegeSet(PrivilegeSet other) { + if (other.isSetUser_privileges()) { + Map __this__user_privileges = new HashMap(); + for (Map.Entry other_element : other.user_privileges.entrySet()) { + + String other_element_key = other_element.getKey(); + String other_element_value = other_element.getValue(); + + String __this__user_privileges_copy_key = other_element_key; + + String __this__user_privileges_copy_value = other_element_value; + + __this__user_privileges.put(__this__user_privileges_copy_key, __this__user_privileges_copy_value); + } + this.user_privileges = __this__user_privileges; + } + if (other.isSetGroup_privileges()) { + Map __this__group_privileges = new HashMap(); + for (Map.Entry other_element : other.group_privileges.entrySet()) { + + String other_element_key = other_element.getKey(); + String other_element_value = other_element.getValue(); + + String __this__group_privileges_copy_key = other_element_key; + + String __this__group_privileges_copy_value = other_element_value; + + __this__group_privileges.put(__this__group_privileges_copy_key, __this__group_privileges_copy_value); + } + this.group_privileges = __this__group_privileges; + } + if (other.isSetRole_privileges()) { + Map __this__role_privileges = new HashMap(); + for (Map.Entry other_element : other.role_privileges.entrySet()) { + + String other_element_key = other_element.getKey(); + String other_element_value = other_element.getValue(); + + String __this__role_privileges_copy_key = other_element_key; + + String __this__role_privileges_copy_value = other_element_value; + + __this__role_privileges.put(__this__role_privileges_copy_key, __this__role_privileges_copy_value); + } + this.role_privileges = __this__role_privileges; + } + } + + @Override + public PrivilegeSet clone() { + return new PrivilegeSet(this); + } + + public int getUser_privilegesSize() { + return (this.user_privileges == null) ? 0 : this.user_privileges.size(); + } + + public void putToUser_privileges(String key, String val) { + if (this.user_privileges == null) { + this.user_privileges = new HashMap(); + } + this.user_privileges.put(key, val); + } + + public Map getUser_privileges() { + return this.user_privileges; + } + + public void setUser_privileges(Map user_privileges) { + this.user_privileges = user_privileges; + } + + public void unsetUser_privileges() { + this.user_privileges = null; + } + + // Returns true if field user_privileges is set (has been asigned a value) and false otherwise + public boolean isSetUser_privileges() { + return this.user_privileges != null; + } + + public int getGroup_privilegesSize() { + return (this.group_privileges == null) ? 0 : this.group_privileges.size(); + } + + public void putToGroup_privileges(String key, String val) { + if (this.group_privileges == null) { + this.group_privileges = new HashMap(); + } + this.group_privileges.put(key, val); + } + + public Map getGroup_privileges() { + return this.group_privileges; + } + + public void setGroup_privileges(Map group_privileges) { + this.group_privileges = group_privileges; + } + + public void unsetGroup_privileges() { + this.group_privileges = null; + } + + // Returns true if field group_privileges is set (has been asigned a value) and false otherwise + public boolean isSetGroup_privileges() { + return this.group_privileges != null; + } + + public int getRole_privilegesSize() { + return (this.role_privileges == null) ? 0 : this.role_privileges.size(); + } + + public void putToRole_privileges(String key, String val) { + if (this.role_privileges == null) { + this.role_privileges = new HashMap(); + } + this.role_privileges.put(key, val); + } + + public Map getRole_privileges() { + return this.role_privileges; + } + + public void setRole_privileges(Map role_privileges) { + this.role_privileges = role_privileges; + } + + public void unsetRole_privileges() { + this.role_privileges = null; + } + + // Returns true if field role_privileges is set (has been asigned a value) and false otherwise + public boolean isSetRole_privileges() { + return this.role_privileges != null; + } + + public void setFieldValue(int fieldID, Object value) { + switch (fieldID) { + case USER_PRIVILEGES: + if (value == null) { + unsetUser_privileges(); + } else { + setUser_privileges((Map)value); + } + break; + + case GROUP_PRIVILEGES: + if (value == null) { + unsetGroup_privileges(); + } else { + setGroup_privileges((Map)value); + } + break; + + case ROLE_PRIVILEGES: + if (value == null) { + unsetRole_privileges(); + } else { + setRole_privileges((Map)value); + } + break; + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + public Object getFieldValue(int fieldID) { + switch (fieldID) { + case USER_PRIVILEGES: + return getUser_privileges(); + + case GROUP_PRIVILEGES: + return getGroup_privileges(); + + case ROLE_PRIVILEGES: + return getRole_privileges(); + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise + public boolean isSet(int fieldID) { + switch (fieldID) { + case USER_PRIVILEGES: + return isSetUser_privileges(); + case GROUP_PRIVILEGES: + return isSetGroup_privileges(); + case ROLE_PRIVILEGES: + return isSetRole_privileges(); + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof PrivilegeSet) + return this.equals((PrivilegeSet)that); + return false; + } + + public boolean equals(PrivilegeSet that) { + if (that == null) + return false; + + boolean this_present_user_privileges = true && this.isSetUser_privileges(); + boolean that_present_user_privileges = true && that.isSetUser_privileges(); + if (this_present_user_privileges || that_present_user_privileges) { + if (!(this_present_user_privileges && that_present_user_privileges)) + return false; + if (!this.user_privileges.equals(that.user_privileges)) + return false; + } + + boolean this_present_group_privileges = true && this.isSetGroup_privileges(); + boolean that_present_group_privileges = true && that.isSetGroup_privileges(); + if (this_present_group_privileges || that_present_group_privileges) { + if (!(this_present_group_privileges && that_present_group_privileges)) + return false; + if (!this.group_privileges.equals(that.group_privileges)) + return false; + } + + boolean this_present_role_privileges = true && this.isSetRole_privileges(); + boolean that_present_role_privileges = true && that.isSetRole_privileges(); + if (this_present_role_privileges || that_present_role_privileges) { + if (!(this_present_role_privileges && that_present_role_privileges)) + return false; + if (!this.role_privileges.equals(that.role_privileges)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + public void read(TProtocol iprot) throws TException { + TField field; + iprot.readStructBegin(); + while (true) + { + field = iprot.readFieldBegin(); + if (field.type == TType.STOP) { + break; + } + switch (field.id) + { + case USER_PRIVILEGES: + if (field.type == TType.MAP) { + { + TMap _map4 = iprot.readMapBegin(); + this.user_privileges = new HashMap(2*_map4.size); + for (int _i5 = 0; _i5 < _map4.size; ++_i5) + { + String _key6; + String _val7; + _key6 = iprot.readString(); + _val7 = iprot.readString(); + this.user_privileges.put(_key6, _val7); + } + iprot.readMapEnd(); + } + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case GROUP_PRIVILEGES: + if (field.type == TType.MAP) { + { + TMap _map8 = iprot.readMapBegin(); + this.group_privileges = new HashMap(2*_map8.size); + for (int _i9 = 0; _i9 < _map8.size; ++_i9) + { + String _key10; + String _val11; + _key10 = iprot.readString(); + _val11 = iprot.readString(); + this.group_privileges.put(_key10, _val11); + } + iprot.readMapEnd(); + } + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case ROLE_PRIVILEGES: + if (field.type == TType.MAP) { + { + TMap _map12 = iprot.readMapBegin(); + this.role_privileges = new HashMap(2*_map12.size); + for (int _i13 = 0; _i13 < _map12.size; ++_i13) + { + String _key14; + String _val15; + _key14 = iprot.readString(); + _val15 = iprot.readString(); + this.role_privileges.put(_key14, _val15); + } + iprot.readMapEnd(); + } + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); + break; + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + validate(); + } + + public void write(TProtocol oprot) throws TException { + validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (this.user_privileges != null) { + oprot.writeFieldBegin(USER_PRIVILEGES_FIELD_DESC); + { + oprot.writeMapBegin(new TMap(TType.STRING, TType.STRING, this.user_privileges.size())); + for (Map.Entry _iter16 : this.user_privileges.entrySet()) { + oprot.writeString(_iter16.getKey()); + oprot.writeString(_iter16.getValue()); + } + oprot.writeMapEnd(); + } + oprot.writeFieldEnd(); + } + if (this.group_privileges != null) { + oprot.writeFieldBegin(GROUP_PRIVILEGES_FIELD_DESC); + { + oprot.writeMapBegin(new TMap(TType.STRING, TType.STRING, this.group_privileges.size())); + for (Map.Entry _iter17 : this.group_privileges.entrySet()) { + oprot.writeString(_iter17.getKey()); + oprot.writeString(_iter17.getValue()); + } + oprot.writeMapEnd(); + } + oprot.writeFieldEnd(); + } + if (this.role_privileges != null) { + oprot.writeFieldBegin(ROLE_PRIVILEGES_FIELD_DESC); + { + oprot.writeMapBegin(new TMap(TType.STRING, TType.STRING, this.role_privileges.size())); + for (Map.Entry _iter18 : this.role_privileges.entrySet()) { + oprot.writeString(_iter18.getKey()); + oprot.writeString(_iter18.getValue()); + } + oprot.writeMapEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("PrivilegeSet("); + boolean first = true; + + sb.append("user_privileges:"); + if (this.user_privileges == null) { + sb.append("null"); + } else { + sb.append(this.user_privileges); + } + first = false; + if (!first) sb.append(", "); + sb.append("group_privileges:"); + if (this.group_privileges == null) { + sb.append("null"); + } else { + sb.append(this.group_privileges); + } + first = false; + if (!first) sb.append(", "); + sb.append("role_privileges:"); + if (this.role_privileges == null) { + sb.append("null"); + } else { + sb.append(this.role_privileges); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws TException { + // check for required fields + // check that fields of type enum have valid values + } + +} + Index: metastore/src/gen-javabean/org/apache/hadoop/hive/metastore/api/Role.java =================================================================== --- metastore/src/gen-javabean/org/apache/hadoop/hive/metastore/api/Role.java (revision 0) +++ metastore/src/gen-javabean/org/apache/hadoop/hive/metastore/api/Role.java (revision 0) @@ -0,0 +1,346 @@ +/** + * Autogenerated by Thrift + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + */ +package org.apache.hadoop.hive.metastore.api; + +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.Set; +import java.util.HashSet; +import java.util.Collections; +import org.apache.log4j.Logger; + +import org.apache.thrift.*; +import org.apache.thrift.meta_data.*; +import org.apache.thrift.protocol.*; + +public class Role implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("Role"); + private static final TField ROLE_NAME_FIELD_DESC = new TField("roleName", TType.STRING, (short)1); + private static final TField CREATE_TIME_FIELD_DESC = new TField("createTime", TType.I32, (short)2); + private static final TField OWNER_NAME_FIELD_DESC = new TField("ownerName", TType.STRING, (short)3); + + private String roleName; + public static final int ROLENAME = 1; + private int createTime; + public static final int CREATETIME = 2; + private String ownerName; + public static final int OWNERNAME = 3; + + private final Isset __isset = new Isset(); + private static final class Isset implements java.io.Serializable { + public boolean createTime = false; + } + + public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ + put(ROLENAME, new FieldMetaData("roleName", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + put(CREATETIME, new FieldMetaData("createTime", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.I32))); + put(OWNERNAME, new FieldMetaData("ownerName", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + }}); + + static { + FieldMetaData.addStructMetaDataMap(Role.class, metaDataMap); + } + + public Role() { + } + + public Role( + String roleName, + int createTime, + String ownerName) + { + this(); + this.roleName = roleName; + this.createTime = createTime; + this.__isset.createTime = true; + this.ownerName = ownerName; + } + + /** + * Performs a deep copy on other. + */ + public Role(Role other) { + if (other.isSetRoleName()) { + this.roleName = other.roleName; + } + __isset.createTime = other.__isset.createTime; + this.createTime = other.createTime; + if (other.isSetOwnerName()) { + this.ownerName = other.ownerName; + } + } + + @Override + public Role clone() { + return new Role(this); + } + + public String getRoleName() { + return this.roleName; + } + + public void setRoleName(String roleName) { + this.roleName = roleName; + } + + public void unsetRoleName() { + this.roleName = null; + } + + // Returns true if field roleName is set (has been asigned a value) and false otherwise + public boolean isSetRoleName() { + return this.roleName != null; + } + + public int getCreateTime() { + return this.createTime; + } + + public void setCreateTime(int createTime) { + this.createTime = createTime; + this.__isset.createTime = true; + } + + public void unsetCreateTime() { + this.__isset.createTime = false; + } + + // Returns true if field createTime is set (has been asigned a value) and false otherwise + public boolean isSetCreateTime() { + return this.__isset.createTime; + } + + public String getOwnerName() { + return this.ownerName; + } + + public void setOwnerName(String ownerName) { + this.ownerName = ownerName; + } + + public void unsetOwnerName() { + this.ownerName = null; + } + + // Returns true if field ownerName is set (has been asigned a value) and false otherwise + public boolean isSetOwnerName() { + return this.ownerName != null; + } + + public void setFieldValue(int fieldID, Object value) { + switch (fieldID) { + case ROLENAME: + if (value == null) { + unsetRoleName(); + } else { + setRoleName((String)value); + } + break; + + case CREATETIME: + if (value == null) { + unsetCreateTime(); + } else { + setCreateTime((Integer)value); + } + break; + + case OWNERNAME: + if (value == null) { + unsetOwnerName(); + } else { + setOwnerName((String)value); + } + break; + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + public Object getFieldValue(int fieldID) { + switch (fieldID) { + case ROLENAME: + return getRoleName(); + + case CREATETIME: + return new Integer(getCreateTime()); + + case OWNERNAME: + return getOwnerName(); + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise + public boolean isSet(int fieldID) { + switch (fieldID) { + case ROLENAME: + return isSetRoleName(); + case CREATETIME: + return isSetCreateTime(); + case OWNERNAME: + return isSetOwnerName(); + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof Role) + return this.equals((Role)that); + return false; + } + + public boolean equals(Role that) { + if (that == null) + return false; + + boolean this_present_roleName = true && this.isSetRoleName(); + boolean that_present_roleName = true && that.isSetRoleName(); + if (this_present_roleName || that_present_roleName) { + if (!(this_present_roleName && that_present_roleName)) + return false; + if (!this.roleName.equals(that.roleName)) + return false; + } + + boolean this_present_createTime = true; + boolean that_present_createTime = true; + if (this_present_createTime || that_present_createTime) { + if (!(this_present_createTime && that_present_createTime)) + return false; + if (this.createTime != that.createTime) + return false; + } + + boolean this_present_ownerName = true && this.isSetOwnerName(); + boolean that_present_ownerName = true && that.isSetOwnerName(); + if (this_present_ownerName || that_present_ownerName) { + if (!(this_present_ownerName && that_present_ownerName)) + return false; + if (!this.ownerName.equals(that.ownerName)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + public void read(TProtocol iprot) throws TException { + TField field; + iprot.readStructBegin(); + while (true) + { + field = iprot.readFieldBegin(); + if (field.type == TType.STOP) { + break; + } + switch (field.id) + { + case ROLENAME: + if (field.type == TType.STRING) { + this.roleName = iprot.readString(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case CREATETIME: + if (field.type == TType.I32) { + this.createTime = iprot.readI32(); + this.__isset.createTime = true; + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case OWNERNAME: + if (field.type == TType.STRING) { + this.ownerName = iprot.readString(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); + break; + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + validate(); + } + + public void write(TProtocol oprot) throws TException { + validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (this.roleName != null) { + oprot.writeFieldBegin(ROLE_NAME_FIELD_DESC); + oprot.writeString(this.roleName); + oprot.writeFieldEnd(); + } + oprot.writeFieldBegin(CREATE_TIME_FIELD_DESC); + oprot.writeI32(this.createTime); + oprot.writeFieldEnd(); + if (this.ownerName != null) { + oprot.writeFieldBegin(OWNER_NAME_FIELD_DESC); + oprot.writeString(this.ownerName); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("Role("); + boolean first = true; + + sb.append("roleName:"); + if (this.roleName == null) { + sb.append("null"); + } else { + sb.append(this.roleName); + } + first = false; + if (!first) sb.append(", "); + sb.append("createTime:"); + sb.append(this.createTime); + first = false; + if (!first) sb.append(", "); + sb.append("ownerName:"); + if (this.ownerName == null) { + sb.append("null"); + } else { + sb.append(this.ownerName); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws TException { + // check for required fields + // check that fields of type enum have valid values + } + +} + Index: metastore/src/gen-javabean/org/apache/hadoop/hive/metastore/api/Schema.java =================================================================== --- metastore/src/gen-javabean/org/apache/hadoop/hive/metastore/api/Schema.java (revision 1030336) +++ metastore/src/gen-javabean/org/apache/hadoop/hive/metastore/api/Schema.java (working copy) @@ -252,14 +252,14 @@ case FIELDSCHEMAS: if (field.type == TType.LIST) { { - TList _list49 = iprot.readListBegin(); - this.fieldSchemas = new ArrayList(_list49.size); - for (int _i50 = 0; _i50 < _list49.size; ++_i50) + TList _list64 = iprot.readListBegin(); + this.fieldSchemas = new ArrayList(_list64.size); + for (int _i65 = 0; _i65 < _list64.size; ++_i65) { - FieldSchema _elem51; - _elem51 = new FieldSchema(); - _elem51.read(iprot); - this.fieldSchemas.add(_elem51); + FieldSchema _elem66; + _elem66 = new FieldSchema(); + _elem66.read(iprot); + this.fieldSchemas.add(_elem66); } iprot.readListEnd(); } @@ -270,15 +270,15 @@ case PROPERTIES: if (field.type == TType.MAP) { { - TMap _map52 = iprot.readMapBegin(); - this.properties = new HashMap(2*_map52.size); - for (int _i53 = 0; _i53 < _map52.size; ++_i53) + TMap _map67 = iprot.readMapBegin(); + this.properties = new HashMap(2*_map67.size); + for (int _i68 = 0; _i68 < _map67.size; ++_i68) { - String _key54; - String _val55; - _key54 = iprot.readString(); - _val55 = iprot.readString(); - this.properties.put(_key54, _val55); + String _key69; + String _val70; + _key69 = iprot.readString(); + _val70 = iprot.readString(); + this.properties.put(_key69, _val70); } iprot.readMapEnd(); } @@ -305,8 +305,8 @@ oprot.writeFieldBegin(FIELD_SCHEMAS_FIELD_DESC); { oprot.writeListBegin(new TList(TType.STRUCT, this.fieldSchemas.size())); - for (FieldSchema _iter56 : this.fieldSchemas) { - _iter56.write(oprot); + for (FieldSchema _iter71 : this.fieldSchemas) { + _iter71.write(oprot); } oprot.writeListEnd(); } @@ -316,9 +316,9 @@ oprot.writeFieldBegin(PROPERTIES_FIELD_DESC); { oprot.writeMapBegin(new TMap(TType.STRING, TType.STRING, this.properties.size())); - for (Map.Entry _iter57 : this.properties.entrySet()) { - oprot.writeString(_iter57.getKey()); - oprot.writeString(_iter57.getValue()); + for (Map.Entry _iter72 : this.properties.entrySet()) { + oprot.writeString(_iter72.getKey()); + oprot.writeString(_iter72.getValue()); } oprot.writeMapEnd(); } Index: metastore/src/gen-javabean/org/apache/hadoop/hive/metastore/api/SecurityColumn.java =================================================================== --- metastore/src/gen-javabean/org/apache/hadoop/hive/metastore/api/SecurityColumn.java (revision 0) +++ metastore/src/gen-javabean/org/apache/hadoop/hive/metastore/api/SecurityColumn.java (revision 0) @@ -0,0 +1,686 @@ +/** + * Autogenerated by Thrift + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + */ +package org.apache.hadoop.hive.metastore.api; + +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.Set; +import java.util.HashSet; +import java.util.Collections; +import org.apache.log4j.Logger; + +import org.apache.thrift.*; +import org.apache.thrift.meta_data.*; +import org.apache.thrift.protocol.*; + +public class SecurityColumn implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("SecurityColumn"); + private static final TField PRINCIPAL_NAME_FIELD_DESC = new TField("principalName", TType.STRING, (short)1); + private static final TField IS_ROLE_FIELD_DESC = new TField("isRole", TType.BOOL, (short)2); + private static final TField IS_GROUP_FIELD_DESC = new TField("isGroup", TType.BOOL, (short)3); + private static final TField PRIVILEGES_FIELD_DESC = new TField("privileges", TType.STRING, (short)4); + private static final TField CREATE_TIME_FIELD_DESC = new TField("createTime", TType.I32, (short)5); + private static final TField GRANTOR_FIELD_DESC = new TField("grantor", TType.STRING, (short)6); + private static final TField TABLE_FIELD_DESC = new TField("table", TType.STRUCT, (short)7); + private static final TField COLUMN_FIELD_DESC = new TField("column", TType.STRING, (short)8); + + private String principalName; + public static final int PRINCIPALNAME = 1; + private boolean isRole; + public static final int ISROLE = 2; + private boolean isGroup; + public static final int ISGROUP = 3; + private String privileges; + public static final int PRIVILEGES = 4; + private int createTime; + public static final int CREATETIME = 5; + private String grantor; + public static final int GRANTOR = 6; + private Table table; + public static final int TABLE = 7; + private String column; + public static final int COLUMN = 8; + + private final Isset __isset = new Isset(); + private static final class Isset implements java.io.Serializable { + public boolean isRole = false; + public boolean isGroup = false; + public boolean createTime = false; + } + + public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ + put(PRINCIPALNAME, new FieldMetaData("principalName", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + put(ISROLE, new FieldMetaData("isRole", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.BOOL))); + put(ISGROUP, new FieldMetaData("isGroup", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.BOOL))); + put(PRIVILEGES, new FieldMetaData("privileges", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + put(CREATETIME, new FieldMetaData("createTime", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.I32))); + put(GRANTOR, new FieldMetaData("grantor", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + put(TABLE, new FieldMetaData("table", TFieldRequirementType.DEFAULT, + new StructMetaData(TType.STRUCT, Table.class))); + put(COLUMN, new FieldMetaData("column", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + }}); + + static { + FieldMetaData.addStructMetaDataMap(SecurityColumn.class, metaDataMap); + } + + public SecurityColumn() { + } + + public SecurityColumn( + String principalName, + boolean isRole, + boolean isGroup, + String privileges, + int createTime, + String grantor, + Table table, + String column) + { + this(); + this.principalName = principalName; + this.isRole = isRole; + this.__isset.isRole = true; + this.isGroup = isGroup; + this.__isset.isGroup = true; + this.privileges = privileges; + this.createTime = createTime; + this.__isset.createTime = true; + this.grantor = grantor; + this.table = table; + this.column = column; + } + + /** + * Performs a deep copy on other. + */ + public SecurityColumn(SecurityColumn other) { + if (other.isSetPrincipalName()) { + this.principalName = other.principalName; + } + __isset.isRole = other.__isset.isRole; + this.isRole = other.isRole; + __isset.isGroup = other.__isset.isGroup; + this.isGroup = other.isGroup; + if (other.isSetPrivileges()) { + this.privileges = other.privileges; + } + __isset.createTime = other.__isset.createTime; + this.createTime = other.createTime; + if (other.isSetGrantor()) { + this.grantor = other.grantor; + } + if (other.isSetTable()) { + this.table = new Table(other.table); + } + if (other.isSetColumn()) { + this.column = other.column; + } + } + + @Override + public SecurityColumn clone() { + return new SecurityColumn(this); + } + + public String getPrincipalName() { + return this.principalName; + } + + public void setPrincipalName(String principalName) { + this.principalName = principalName; + } + + public void unsetPrincipalName() { + this.principalName = null; + } + + // Returns true if field principalName is set (has been asigned a value) and false otherwise + public boolean isSetPrincipalName() { + return this.principalName != null; + } + + public boolean isIsRole() { + return this.isRole; + } + + public void setIsRole(boolean isRole) { + this.isRole = isRole; + this.__isset.isRole = true; + } + + public void unsetIsRole() { + this.__isset.isRole = false; + } + + // Returns true if field isRole is set (has been asigned a value) and false otherwise + public boolean isSetIsRole() { + return this.__isset.isRole; + } + + public boolean isIsGroup() { + return this.isGroup; + } + + public void setIsGroup(boolean isGroup) { + this.isGroup = isGroup; + this.__isset.isGroup = true; + } + + public void unsetIsGroup() { + this.__isset.isGroup = false; + } + + // Returns true if field isGroup is set (has been asigned a value) and false otherwise + public boolean isSetIsGroup() { + return this.__isset.isGroup; + } + + public String getPrivileges() { + return this.privileges; + } + + public void setPrivileges(String privileges) { + this.privileges = privileges; + } + + public void unsetPrivileges() { + this.privileges = null; + } + + // Returns true if field privileges is set (has been asigned a value) and false otherwise + public boolean isSetPrivileges() { + return this.privileges != null; + } + + public int getCreateTime() { + return this.createTime; + } + + public void setCreateTime(int createTime) { + this.createTime = createTime; + this.__isset.createTime = true; + } + + public void unsetCreateTime() { + this.__isset.createTime = false; + } + + // Returns true if field createTime is set (has been asigned a value) and false otherwise + public boolean isSetCreateTime() { + return this.__isset.createTime; + } + + public String getGrantor() { + return this.grantor; + } + + public void setGrantor(String grantor) { + this.grantor = grantor; + } + + public void unsetGrantor() { + this.grantor = null; + } + + // Returns true if field grantor is set (has been asigned a value) and false otherwise + public boolean isSetGrantor() { + return this.grantor != null; + } + + public Table getTable() { + return this.table; + } + + public void setTable(Table table) { + this.table = table; + } + + public void unsetTable() { + this.table = null; + } + + // Returns true if field table is set (has been asigned a value) and false otherwise + public boolean isSetTable() { + return this.table != null; + } + + public String getColumn() { + return this.column; + } + + public void setColumn(String column) { + this.column = column; + } + + public void unsetColumn() { + this.column = null; + } + + // Returns true if field column is set (has been asigned a value) and false otherwise + public boolean isSetColumn() { + return this.column != null; + } + + public void setFieldValue(int fieldID, Object value) { + switch (fieldID) { + case PRINCIPALNAME: + if (value == null) { + unsetPrincipalName(); + } else { + setPrincipalName((String)value); + } + break; + + case ISROLE: + if (value == null) { + unsetIsRole(); + } else { + setIsRole((Boolean)value); + } + break; + + case ISGROUP: + if (value == null) { + unsetIsGroup(); + } else { + setIsGroup((Boolean)value); + } + break; + + case PRIVILEGES: + if (value == null) { + unsetPrivileges(); + } else { + setPrivileges((String)value); + } + break; + + case CREATETIME: + if (value == null) { + unsetCreateTime(); + } else { + setCreateTime((Integer)value); + } + break; + + case GRANTOR: + if (value == null) { + unsetGrantor(); + } else { + setGrantor((String)value); + } + break; + + case TABLE: + if (value == null) { + unsetTable(); + } else { + setTable((Table)value); + } + break; + + case COLUMN: + if (value == null) { + unsetColumn(); + } else { + setColumn((String)value); + } + break; + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + public Object getFieldValue(int fieldID) { + switch (fieldID) { + case PRINCIPALNAME: + return getPrincipalName(); + + case ISROLE: + return new Boolean(isIsRole()); + + case ISGROUP: + return new Boolean(isIsGroup()); + + case PRIVILEGES: + return getPrivileges(); + + case CREATETIME: + return new Integer(getCreateTime()); + + case GRANTOR: + return getGrantor(); + + case TABLE: + return getTable(); + + case COLUMN: + return getColumn(); + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise + public boolean isSet(int fieldID) { + switch (fieldID) { + case PRINCIPALNAME: + return isSetPrincipalName(); + case ISROLE: + return isSetIsRole(); + case ISGROUP: + return isSetIsGroup(); + case PRIVILEGES: + return isSetPrivileges(); + case CREATETIME: + return isSetCreateTime(); + case GRANTOR: + return isSetGrantor(); + case TABLE: + return isSetTable(); + case COLUMN: + return isSetColumn(); + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof SecurityColumn) + return this.equals((SecurityColumn)that); + return false; + } + + public boolean equals(SecurityColumn that) { + if (that == null) + return false; + + boolean this_present_principalName = true && this.isSetPrincipalName(); + boolean that_present_principalName = true && that.isSetPrincipalName(); + if (this_present_principalName || that_present_principalName) { + if (!(this_present_principalName && that_present_principalName)) + return false; + if (!this.principalName.equals(that.principalName)) + return false; + } + + boolean this_present_isRole = true; + boolean that_present_isRole = true; + if (this_present_isRole || that_present_isRole) { + if (!(this_present_isRole && that_present_isRole)) + return false; + if (this.isRole != that.isRole) + return false; + } + + boolean this_present_isGroup = true; + boolean that_present_isGroup = true; + if (this_present_isGroup || that_present_isGroup) { + if (!(this_present_isGroup && that_present_isGroup)) + return false; + if (this.isGroup != that.isGroup) + return false; + } + + boolean this_present_privileges = true && this.isSetPrivileges(); + boolean that_present_privileges = true && that.isSetPrivileges(); + if (this_present_privileges || that_present_privileges) { + if (!(this_present_privileges && that_present_privileges)) + return false; + if (!this.privileges.equals(that.privileges)) + return false; + } + + boolean this_present_createTime = true; + boolean that_present_createTime = true; + if (this_present_createTime || that_present_createTime) { + if (!(this_present_createTime && that_present_createTime)) + return false; + if (this.createTime != that.createTime) + return false; + } + + boolean this_present_grantor = true && this.isSetGrantor(); + boolean that_present_grantor = true && that.isSetGrantor(); + if (this_present_grantor || that_present_grantor) { + if (!(this_present_grantor && that_present_grantor)) + return false; + if (!this.grantor.equals(that.grantor)) + return false; + } + + boolean this_present_table = true && this.isSetTable(); + boolean that_present_table = true && that.isSetTable(); + if (this_present_table || that_present_table) { + if (!(this_present_table && that_present_table)) + return false; + if (!this.table.equals(that.table)) + return false; + } + + boolean this_present_column = true && this.isSetColumn(); + boolean that_present_column = true && that.isSetColumn(); + if (this_present_column || that_present_column) { + if (!(this_present_column && that_present_column)) + return false; + if (!this.column.equals(that.column)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + public void read(TProtocol iprot) throws TException { + TField field; + iprot.readStructBegin(); + while (true) + { + field = iprot.readFieldBegin(); + if (field.type == TType.STOP) { + break; + } + switch (field.id) + { + case PRINCIPALNAME: + if (field.type == TType.STRING) { + this.principalName = iprot.readString(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case ISROLE: + if (field.type == TType.BOOL) { + this.isRole = iprot.readBool(); + this.__isset.isRole = true; + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case ISGROUP: + if (field.type == TType.BOOL) { + this.isGroup = iprot.readBool(); + this.__isset.isGroup = true; + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case PRIVILEGES: + if (field.type == TType.STRING) { + this.privileges = iprot.readString(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case CREATETIME: + if (field.type == TType.I32) { + this.createTime = iprot.readI32(); + this.__isset.createTime = true; + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case GRANTOR: + if (field.type == TType.STRING) { + this.grantor = iprot.readString(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case TABLE: + if (field.type == TType.STRUCT) { + this.table = new Table(); + this.table.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case COLUMN: + if (field.type == TType.STRING) { + this.column = iprot.readString(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); + break; + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + validate(); + } + + public void write(TProtocol oprot) throws TException { + validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (this.principalName != null) { + oprot.writeFieldBegin(PRINCIPAL_NAME_FIELD_DESC); + oprot.writeString(this.principalName); + oprot.writeFieldEnd(); + } + oprot.writeFieldBegin(IS_ROLE_FIELD_DESC); + oprot.writeBool(this.isRole); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(IS_GROUP_FIELD_DESC); + oprot.writeBool(this.isGroup); + oprot.writeFieldEnd(); + if (this.privileges != null) { + oprot.writeFieldBegin(PRIVILEGES_FIELD_DESC); + oprot.writeString(this.privileges); + oprot.writeFieldEnd(); + } + oprot.writeFieldBegin(CREATE_TIME_FIELD_DESC); + oprot.writeI32(this.createTime); + oprot.writeFieldEnd(); + if (this.grantor != null) { + oprot.writeFieldBegin(GRANTOR_FIELD_DESC); + oprot.writeString(this.grantor); + oprot.writeFieldEnd(); + } + if (this.table != null) { + oprot.writeFieldBegin(TABLE_FIELD_DESC); + this.table.write(oprot); + oprot.writeFieldEnd(); + } + if (this.column != null) { + oprot.writeFieldBegin(COLUMN_FIELD_DESC); + oprot.writeString(this.column); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("SecurityColumn("); + boolean first = true; + + sb.append("principalName:"); + if (this.principalName == null) { + sb.append("null"); + } else { + sb.append(this.principalName); + } + first = false; + if (!first) sb.append(", "); + sb.append("isRole:"); + sb.append(this.isRole); + first = false; + if (!first) sb.append(", "); + sb.append("isGroup:"); + sb.append(this.isGroup); + first = false; + if (!first) sb.append(", "); + sb.append("privileges:"); + if (this.privileges == null) { + sb.append("null"); + } else { + sb.append(this.privileges); + } + first = false; + if (!first) sb.append(", "); + sb.append("createTime:"); + sb.append(this.createTime); + first = false; + if (!first) sb.append(", "); + sb.append("grantor:"); + if (this.grantor == null) { + sb.append("null"); + } else { + sb.append(this.grantor); + } + first = false; + if (!first) sb.append(", "); + sb.append("table:"); + if (this.table == null) { + sb.append("null"); + } else { + sb.append(this.table); + } + first = false; + if (!first) sb.append(", "); + sb.append("column:"); + if (this.column == null) { + sb.append("null"); + } else { + sb.append(this.column); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws TException { + // check for required fields + // check that fields of type enum have valid values + } + +} + Index: metastore/src/gen-javabean/org/apache/hadoop/hive/metastore/api/SecurityDB.java =================================================================== --- metastore/src/gen-javabean/org/apache/hadoop/hive/metastore/api/SecurityDB.java (revision 0) +++ metastore/src/gen-javabean/org/apache/hadoop/hive/metastore/api/SecurityDB.java (revision 0) @@ -0,0 +1,617 @@ +/** + * Autogenerated by Thrift + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + */ +package org.apache.hadoop.hive.metastore.api; + +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.Set; +import java.util.HashSet; +import java.util.Collections; +import org.apache.log4j.Logger; + +import org.apache.thrift.*; +import org.apache.thrift.meta_data.*; +import org.apache.thrift.protocol.*; + +public class SecurityDB implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("SecurityDB"); + private static final TField PRINCIPAL_NAME_FIELD_DESC = new TField("principalName", TType.STRING, (short)1); + private static final TField IS_ROLE_FIELD_DESC = new TField("isRole", TType.BOOL, (short)2); + private static final TField IS_GROUP_FIELD_DESC = new TField("isGroup", TType.BOOL, (short)3); + private static final TField PRIVILEGES_FIELD_DESC = new TField("privileges", TType.STRING, (short)4); + private static final TField CREATE_TIME_FIELD_DESC = new TField("createTime", TType.I32, (short)5); + private static final TField GRANTOR_FIELD_DESC = new TField("grantor", TType.STRING, (short)6); + private static final TField DB_FIELD_DESC = new TField("db", TType.STRUCT, (short)7); + + private String principalName; + public static final int PRINCIPALNAME = 1; + private boolean isRole; + public static final int ISROLE = 2; + private boolean isGroup; + public static final int ISGROUP = 3; + private String privileges; + public static final int PRIVILEGES = 4; + private int createTime; + public static final int CREATETIME = 5; + private String grantor; + public static final int GRANTOR = 6; + private Database db; + public static final int DB = 7; + + private final Isset __isset = new Isset(); + private static final class Isset implements java.io.Serializable { + public boolean isRole = false; + public boolean isGroup = false; + public boolean createTime = false; + } + + public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ + put(PRINCIPALNAME, new FieldMetaData("principalName", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + put(ISROLE, new FieldMetaData("isRole", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.BOOL))); + put(ISGROUP, new FieldMetaData("isGroup", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.BOOL))); + put(PRIVILEGES, new FieldMetaData("privileges", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + put(CREATETIME, new FieldMetaData("createTime", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.I32))); + put(GRANTOR, new FieldMetaData("grantor", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + put(DB, new FieldMetaData("db", TFieldRequirementType.DEFAULT, + new StructMetaData(TType.STRUCT, Database.class))); + }}); + + static { + FieldMetaData.addStructMetaDataMap(SecurityDB.class, metaDataMap); + } + + public SecurityDB() { + } + + public SecurityDB( + String principalName, + boolean isRole, + boolean isGroup, + String privileges, + int createTime, + String grantor, + Database db) + { + this(); + this.principalName = principalName; + this.isRole = isRole; + this.__isset.isRole = true; + this.isGroup = isGroup; + this.__isset.isGroup = true; + this.privileges = privileges; + this.createTime = createTime; + this.__isset.createTime = true; + this.grantor = grantor; + this.db = db; + } + + /** + * Performs a deep copy on other. + */ + public SecurityDB(SecurityDB other) { + if (other.isSetPrincipalName()) { + this.principalName = other.principalName; + } + __isset.isRole = other.__isset.isRole; + this.isRole = other.isRole; + __isset.isGroup = other.__isset.isGroup; + this.isGroup = other.isGroup; + if (other.isSetPrivileges()) { + this.privileges = other.privileges; + } + __isset.createTime = other.__isset.createTime; + this.createTime = other.createTime; + if (other.isSetGrantor()) { + this.grantor = other.grantor; + } + if (other.isSetDb()) { + this.db = new Database(other.db); + } + } + + @Override + public SecurityDB clone() { + return new SecurityDB(this); + } + + public String getPrincipalName() { + return this.principalName; + } + + public void setPrincipalName(String principalName) { + this.principalName = principalName; + } + + public void unsetPrincipalName() { + this.principalName = null; + } + + // Returns true if field principalName is set (has been asigned a value) and false otherwise + public boolean isSetPrincipalName() { + return this.principalName != null; + } + + public boolean isIsRole() { + return this.isRole; + } + + public void setIsRole(boolean isRole) { + this.isRole = isRole; + this.__isset.isRole = true; + } + + public void unsetIsRole() { + this.__isset.isRole = false; + } + + // Returns true if field isRole is set (has been asigned a value) and false otherwise + public boolean isSetIsRole() { + return this.__isset.isRole; + } + + public boolean isIsGroup() { + return this.isGroup; + } + + public void setIsGroup(boolean isGroup) { + this.isGroup = isGroup; + this.__isset.isGroup = true; + } + + public void unsetIsGroup() { + this.__isset.isGroup = false; + } + + // Returns true if field isGroup is set (has been asigned a value) and false otherwise + public boolean isSetIsGroup() { + return this.__isset.isGroup; + } + + public String getPrivileges() { + return this.privileges; + } + + public void setPrivileges(String privileges) { + this.privileges = privileges; + } + + public void unsetPrivileges() { + this.privileges = null; + } + + // Returns true if field privileges is set (has been asigned a value) and false otherwise + public boolean isSetPrivileges() { + return this.privileges != null; + } + + public int getCreateTime() { + return this.createTime; + } + + public void setCreateTime(int createTime) { + this.createTime = createTime; + this.__isset.createTime = true; + } + + public void unsetCreateTime() { + this.__isset.createTime = false; + } + + // Returns true if field createTime is set (has been asigned a value) and false otherwise + public boolean isSetCreateTime() { + return this.__isset.createTime; + } + + public String getGrantor() { + return this.grantor; + } + + public void setGrantor(String grantor) { + this.grantor = grantor; + } + + public void unsetGrantor() { + this.grantor = null; + } + + // Returns true if field grantor is set (has been asigned a value) and false otherwise + public boolean isSetGrantor() { + return this.grantor != null; + } + + public Database getDb() { + return this.db; + } + + public void setDb(Database db) { + this.db = db; + } + + public void unsetDb() { + this.db = null; + } + + // Returns true if field db is set (has been asigned a value) and false otherwise + public boolean isSetDb() { + return this.db != null; + } + + public void setFieldValue(int fieldID, Object value) { + switch (fieldID) { + case PRINCIPALNAME: + if (value == null) { + unsetPrincipalName(); + } else { + setPrincipalName((String)value); + } + break; + + case ISROLE: + if (value == null) { + unsetIsRole(); + } else { + setIsRole((Boolean)value); + } + break; + + case ISGROUP: + if (value == null) { + unsetIsGroup(); + } else { + setIsGroup((Boolean)value); + } + break; + + case PRIVILEGES: + if (value == null) { + unsetPrivileges(); + } else { + setPrivileges((String)value); + } + break; + + case CREATETIME: + if (value == null) { + unsetCreateTime(); + } else { + setCreateTime((Integer)value); + } + break; + + case GRANTOR: + if (value == null) { + unsetGrantor(); + } else { + setGrantor((String)value); + } + break; + + case DB: + if (value == null) { + unsetDb(); + } else { + setDb((Database)value); + } + break; + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + public Object getFieldValue(int fieldID) { + switch (fieldID) { + case PRINCIPALNAME: + return getPrincipalName(); + + case ISROLE: + return new Boolean(isIsRole()); + + case ISGROUP: + return new Boolean(isIsGroup()); + + case PRIVILEGES: + return getPrivileges(); + + case CREATETIME: + return new Integer(getCreateTime()); + + case GRANTOR: + return getGrantor(); + + case DB: + return getDb(); + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise + public boolean isSet(int fieldID) { + switch (fieldID) { + case PRINCIPALNAME: + return isSetPrincipalName(); + case ISROLE: + return isSetIsRole(); + case ISGROUP: + return isSetIsGroup(); + case PRIVILEGES: + return isSetPrivileges(); + case CREATETIME: + return isSetCreateTime(); + case GRANTOR: + return isSetGrantor(); + case DB: + return isSetDb(); + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof SecurityDB) + return this.equals((SecurityDB)that); + return false; + } + + public boolean equals(SecurityDB that) { + if (that == null) + return false; + + boolean this_present_principalName = true && this.isSetPrincipalName(); + boolean that_present_principalName = true && that.isSetPrincipalName(); + if (this_present_principalName || that_present_principalName) { + if (!(this_present_principalName && that_present_principalName)) + return false; + if (!this.principalName.equals(that.principalName)) + return false; + } + + boolean this_present_isRole = true; + boolean that_present_isRole = true; + if (this_present_isRole || that_present_isRole) { + if (!(this_present_isRole && that_present_isRole)) + return false; + if (this.isRole != that.isRole) + return false; + } + + boolean this_present_isGroup = true; + boolean that_present_isGroup = true; + if (this_present_isGroup || that_present_isGroup) { + if (!(this_present_isGroup && that_present_isGroup)) + return false; + if (this.isGroup != that.isGroup) + return false; + } + + boolean this_present_privileges = true && this.isSetPrivileges(); + boolean that_present_privileges = true && that.isSetPrivileges(); + if (this_present_privileges || that_present_privileges) { + if (!(this_present_privileges && that_present_privileges)) + return false; + if (!this.privileges.equals(that.privileges)) + return false; + } + + boolean this_present_createTime = true; + boolean that_present_createTime = true; + if (this_present_createTime || that_present_createTime) { + if (!(this_present_createTime && that_present_createTime)) + return false; + if (this.createTime != that.createTime) + return false; + } + + boolean this_present_grantor = true && this.isSetGrantor(); + boolean that_present_grantor = true && that.isSetGrantor(); + if (this_present_grantor || that_present_grantor) { + if (!(this_present_grantor && that_present_grantor)) + return false; + if (!this.grantor.equals(that.grantor)) + return false; + } + + boolean this_present_db = true && this.isSetDb(); + boolean that_present_db = true && that.isSetDb(); + if (this_present_db || that_present_db) { + if (!(this_present_db && that_present_db)) + return false; + if (!this.db.equals(that.db)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + public void read(TProtocol iprot) throws TException { + TField field; + iprot.readStructBegin(); + while (true) + { + field = iprot.readFieldBegin(); + if (field.type == TType.STOP) { + break; + } + switch (field.id) + { + case PRINCIPALNAME: + if (field.type == TType.STRING) { + this.principalName = iprot.readString(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case ISROLE: + if (field.type == TType.BOOL) { + this.isRole = iprot.readBool(); + this.__isset.isRole = true; + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case ISGROUP: + if (field.type == TType.BOOL) { + this.isGroup = iprot.readBool(); + this.__isset.isGroup = true; + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case PRIVILEGES: + if (field.type == TType.STRING) { + this.privileges = iprot.readString(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case CREATETIME: + if (field.type == TType.I32) { + this.createTime = iprot.readI32(); + this.__isset.createTime = true; + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case GRANTOR: + if (field.type == TType.STRING) { + this.grantor = iprot.readString(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case DB: + if (field.type == TType.STRUCT) { + this.db = new Database(); + this.db.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); + break; + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + validate(); + } + + public void write(TProtocol oprot) throws TException { + validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (this.principalName != null) { + oprot.writeFieldBegin(PRINCIPAL_NAME_FIELD_DESC); + oprot.writeString(this.principalName); + oprot.writeFieldEnd(); + } + oprot.writeFieldBegin(IS_ROLE_FIELD_DESC); + oprot.writeBool(this.isRole); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(IS_GROUP_FIELD_DESC); + oprot.writeBool(this.isGroup); + oprot.writeFieldEnd(); + if (this.privileges != null) { + oprot.writeFieldBegin(PRIVILEGES_FIELD_DESC); + oprot.writeString(this.privileges); + oprot.writeFieldEnd(); + } + oprot.writeFieldBegin(CREATE_TIME_FIELD_DESC); + oprot.writeI32(this.createTime); + oprot.writeFieldEnd(); + if (this.grantor != null) { + oprot.writeFieldBegin(GRANTOR_FIELD_DESC); + oprot.writeString(this.grantor); + oprot.writeFieldEnd(); + } + if (this.db != null) { + oprot.writeFieldBegin(DB_FIELD_DESC); + this.db.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("SecurityDB("); + boolean first = true; + + sb.append("principalName:"); + if (this.principalName == null) { + sb.append("null"); + } else { + sb.append(this.principalName); + } + first = false; + if (!first) sb.append(", "); + sb.append("isRole:"); + sb.append(this.isRole); + first = false; + if (!first) sb.append(", "); + sb.append("isGroup:"); + sb.append(this.isGroup); + first = false; + if (!first) sb.append(", "); + sb.append("privileges:"); + if (this.privileges == null) { + sb.append("null"); + } else { + sb.append(this.privileges); + } + first = false; + if (!first) sb.append(", "); + sb.append("createTime:"); + sb.append(this.createTime); + first = false; + if (!first) sb.append(", "); + sb.append("grantor:"); + if (this.grantor == null) { + sb.append("null"); + } else { + sb.append(this.grantor); + } + first = false; + if (!first) sb.append(", "); + sb.append("db:"); + if (this.db == null) { + sb.append("null"); + } else { + sb.append(this.db); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws TException { + // check for required fields + // check that fields of type enum have valid values + } + +} + Index: metastore/src/gen-javabean/org/apache/hadoop/hive/metastore/api/SecurityTablePartition.java =================================================================== --- metastore/src/gen-javabean/org/apache/hadoop/hive/metastore/api/SecurityTablePartition.java (revision 0) +++ metastore/src/gen-javabean/org/apache/hadoop/hive/metastore/api/SecurityTablePartition.java (revision 0) @@ -0,0 +1,687 @@ +/** + * Autogenerated by Thrift + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + */ +package org.apache.hadoop.hive.metastore.api; + +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.Set; +import java.util.HashSet; +import java.util.Collections; +import org.apache.log4j.Logger; + +import org.apache.thrift.*; +import org.apache.thrift.meta_data.*; +import org.apache.thrift.protocol.*; + +public class SecurityTablePartition implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("SecurityTablePartition"); + private static final TField PRINCIPAL_NAME_FIELD_DESC = new TField("principalName", TType.STRING, (short)1); + private static final TField IS_ROLE_FIELD_DESC = new TField("isRole", TType.BOOL, (short)2); + private static final TField IS_GROUP_FIELD_DESC = new TField("isGroup", TType.BOOL, (short)3); + private static final TField PRIVILEGES_FIELD_DESC = new TField("privileges", TType.STRING, (short)4); + private static final TField CREATE_TIME_FIELD_DESC = new TField("createTime", TType.I32, (short)5); + private static final TField GRANTOR_FIELD_DESC = new TField("grantor", TType.STRING, (short)6); + private static final TField TABLE_FIELD_DESC = new TField("table", TType.STRUCT, (short)7); + private static final TField PART_FIELD_DESC = new TField("part", TType.STRUCT, (short)8); + + private String principalName; + public static final int PRINCIPALNAME = 1; + private boolean isRole; + public static final int ISROLE = 2; + private boolean isGroup; + public static final int ISGROUP = 3; + private String privileges; + public static final int PRIVILEGES = 4; + private int createTime; + public static final int CREATETIME = 5; + private String grantor; + public static final int GRANTOR = 6; + private Table table; + public static final int TABLE = 7; + private Partition part; + public static final int PART = 8; + + private final Isset __isset = new Isset(); + private static final class Isset implements java.io.Serializable { + public boolean isRole = false; + public boolean isGroup = false; + public boolean createTime = false; + } + + public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ + put(PRINCIPALNAME, new FieldMetaData("principalName", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + put(ISROLE, new FieldMetaData("isRole", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.BOOL))); + put(ISGROUP, new FieldMetaData("isGroup", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.BOOL))); + put(PRIVILEGES, new FieldMetaData("privileges", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + put(CREATETIME, new FieldMetaData("createTime", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.I32))); + put(GRANTOR, new FieldMetaData("grantor", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + put(TABLE, new FieldMetaData("table", TFieldRequirementType.DEFAULT, + new StructMetaData(TType.STRUCT, Table.class))); + put(PART, new FieldMetaData("part", TFieldRequirementType.DEFAULT, + new StructMetaData(TType.STRUCT, Partition.class))); + }}); + + static { + FieldMetaData.addStructMetaDataMap(SecurityTablePartition.class, metaDataMap); + } + + public SecurityTablePartition() { + } + + public SecurityTablePartition( + String principalName, + boolean isRole, + boolean isGroup, + String privileges, + int createTime, + String grantor, + Table table, + Partition part) + { + this(); + this.principalName = principalName; + this.isRole = isRole; + this.__isset.isRole = true; + this.isGroup = isGroup; + this.__isset.isGroup = true; + this.privileges = privileges; + this.createTime = createTime; + this.__isset.createTime = true; + this.grantor = grantor; + this.table = table; + this.part = part; + } + + /** + * Performs a deep copy on other. + */ + public SecurityTablePartition(SecurityTablePartition other) { + if (other.isSetPrincipalName()) { + this.principalName = other.principalName; + } + __isset.isRole = other.__isset.isRole; + this.isRole = other.isRole; + __isset.isGroup = other.__isset.isGroup; + this.isGroup = other.isGroup; + if (other.isSetPrivileges()) { + this.privileges = other.privileges; + } + __isset.createTime = other.__isset.createTime; + this.createTime = other.createTime; + if (other.isSetGrantor()) { + this.grantor = other.grantor; + } + if (other.isSetTable()) { + this.table = new Table(other.table); + } + if (other.isSetPart()) { + this.part = new Partition(other.part); + } + } + + @Override + public SecurityTablePartition clone() { + return new SecurityTablePartition(this); + } + + public String getPrincipalName() { + return this.principalName; + } + + public void setPrincipalName(String principalName) { + this.principalName = principalName; + } + + public void unsetPrincipalName() { + this.principalName = null; + } + + // Returns true if field principalName is set (has been asigned a value) and false otherwise + public boolean isSetPrincipalName() { + return this.principalName != null; + } + + public boolean isIsRole() { + return this.isRole; + } + + public void setIsRole(boolean isRole) { + this.isRole = isRole; + this.__isset.isRole = true; + } + + public void unsetIsRole() { + this.__isset.isRole = false; + } + + // Returns true if field isRole is set (has been asigned a value) and false otherwise + public boolean isSetIsRole() { + return this.__isset.isRole; + } + + public boolean isIsGroup() { + return this.isGroup; + } + + public void setIsGroup(boolean isGroup) { + this.isGroup = isGroup; + this.__isset.isGroup = true; + } + + public void unsetIsGroup() { + this.__isset.isGroup = false; + } + + // Returns true if field isGroup is set (has been asigned a value) and false otherwise + public boolean isSetIsGroup() { + return this.__isset.isGroup; + } + + public String getPrivileges() { + return this.privileges; + } + + public void setPrivileges(String privileges) { + this.privileges = privileges; + } + + public void unsetPrivileges() { + this.privileges = null; + } + + // Returns true if field privileges is set (has been asigned a value) and false otherwise + public boolean isSetPrivileges() { + return this.privileges != null; + } + + public int getCreateTime() { + return this.createTime; + } + + public void setCreateTime(int createTime) { + this.createTime = createTime; + this.__isset.createTime = true; + } + + public void unsetCreateTime() { + this.__isset.createTime = false; + } + + // Returns true if field createTime is set (has been asigned a value) and false otherwise + public boolean isSetCreateTime() { + return this.__isset.createTime; + } + + public String getGrantor() { + return this.grantor; + } + + public void setGrantor(String grantor) { + this.grantor = grantor; + } + + public void unsetGrantor() { + this.grantor = null; + } + + // Returns true if field grantor is set (has been asigned a value) and false otherwise + public boolean isSetGrantor() { + return this.grantor != null; + } + + public Table getTable() { + return this.table; + } + + public void setTable(Table table) { + this.table = table; + } + + public void unsetTable() { + this.table = null; + } + + // Returns true if field table is set (has been asigned a value) and false otherwise + public boolean isSetTable() { + return this.table != null; + } + + public Partition getPart() { + return this.part; + } + + public void setPart(Partition part) { + this.part = part; + } + + public void unsetPart() { + this.part = null; + } + + // Returns true if field part is set (has been asigned a value) and false otherwise + public boolean isSetPart() { + return this.part != null; + } + + public void setFieldValue(int fieldID, Object value) { + switch (fieldID) { + case PRINCIPALNAME: + if (value == null) { + unsetPrincipalName(); + } else { + setPrincipalName((String)value); + } + break; + + case ISROLE: + if (value == null) { + unsetIsRole(); + } else { + setIsRole((Boolean)value); + } + break; + + case ISGROUP: + if (value == null) { + unsetIsGroup(); + } else { + setIsGroup((Boolean)value); + } + break; + + case PRIVILEGES: + if (value == null) { + unsetPrivileges(); + } else { + setPrivileges((String)value); + } + break; + + case CREATETIME: + if (value == null) { + unsetCreateTime(); + } else { + setCreateTime((Integer)value); + } + break; + + case GRANTOR: + if (value == null) { + unsetGrantor(); + } else { + setGrantor((String)value); + } + break; + + case TABLE: + if (value == null) { + unsetTable(); + } else { + setTable((Table)value); + } + break; + + case PART: + if (value == null) { + unsetPart(); + } else { + setPart((Partition)value); + } + break; + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + public Object getFieldValue(int fieldID) { + switch (fieldID) { + case PRINCIPALNAME: + return getPrincipalName(); + + case ISROLE: + return new Boolean(isIsRole()); + + case ISGROUP: + return new Boolean(isIsGroup()); + + case PRIVILEGES: + return getPrivileges(); + + case CREATETIME: + return new Integer(getCreateTime()); + + case GRANTOR: + return getGrantor(); + + case TABLE: + return getTable(); + + case PART: + return getPart(); + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise + public boolean isSet(int fieldID) { + switch (fieldID) { + case PRINCIPALNAME: + return isSetPrincipalName(); + case ISROLE: + return isSetIsRole(); + case ISGROUP: + return isSetIsGroup(); + case PRIVILEGES: + return isSetPrivileges(); + case CREATETIME: + return isSetCreateTime(); + case GRANTOR: + return isSetGrantor(); + case TABLE: + return isSetTable(); + case PART: + return isSetPart(); + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof SecurityTablePartition) + return this.equals((SecurityTablePartition)that); + return false; + } + + public boolean equals(SecurityTablePartition that) { + if (that == null) + return false; + + boolean this_present_principalName = true && this.isSetPrincipalName(); + boolean that_present_principalName = true && that.isSetPrincipalName(); + if (this_present_principalName || that_present_principalName) { + if (!(this_present_principalName && that_present_principalName)) + return false; + if (!this.principalName.equals(that.principalName)) + return false; + } + + boolean this_present_isRole = true; + boolean that_present_isRole = true; + if (this_present_isRole || that_present_isRole) { + if (!(this_present_isRole && that_present_isRole)) + return false; + if (this.isRole != that.isRole) + return false; + } + + boolean this_present_isGroup = true; + boolean that_present_isGroup = true; + if (this_present_isGroup || that_present_isGroup) { + if (!(this_present_isGroup && that_present_isGroup)) + return false; + if (this.isGroup != that.isGroup) + return false; + } + + boolean this_present_privileges = true && this.isSetPrivileges(); + boolean that_present_privileges = true && that.isSetPrivileges(); + if (this_present_privileges || that_present_privileges) { + if (!(this_present_privileges && that_present_privileges)) + return false; + if (!this.privileges.equals(that.privileges)) + return false; + } + + boolean this_present_createTime = true; + boolean that_present_createTime = true; + if (this_present_createTime || that_present_createTime) { + if (!(this_present_createTime && that_present_createTime)) + return false; + if (this.createTime != that.createTime) + return false; + } + + boolean this_present_grantor = true && this.isSetGrantor(); + boolean that_present_grantor = true && that.isSetGrantor(); + if (this_present_grantor || that_present_grantor) { + if (!(this_present_grantor && that_present_grantor)) + return false; + if (!this.grantor.equals(that.grantor)) + return false; + } + + boolean this_present_table = true && this.isSetTable(); + boolean that_present_table = true && that.isSetTable(); + if (this_present_table || that_present_table) { + if (!(this_present_table && that_present_table)) + return false; + if (!this.table.equals(that.table)) + return false; + } + + boolean this_present_part = true && this.isSetPart(); + boolean that_present_part = true && that.isSetPart(); + if (this_present_part || that_present_part) { + if (!(this_present_part && that_present_part)) + return false; + if (!this.part.equals(that.part)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + public void read(TProtocol iprot) throws TException { + TField field; + iprot.readStructBegin(); + while (true) + { + field = iprot.readFieldBegin(); + if (field.type == TType.STOP) { + break; + } + switch (field.id) + { + case PRINCIPALNAME: + if (field.type == TType.STRING) { + this.principalName = iprot.readString(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case ISROLE: + if (field.type == TType.BOOL) { + this.isRole = iprot.readBool(); + this.__isset.isRole = true; + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case ISGROUP: + if (field.type == TType.BOOL) { + this.isGroup = iprot.readBool(); + this.__isset.isGroup = true; + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case PRIVILEGES: + if (field.type == TType.STRING) { + this.privileges = iprot.readString(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case CREATETIME: + if (field.type == TType.I32) { + this.createTime = iprot.readI32(); + this.__isset.createTime = true; + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case GRANTOR: + if (field.type == TType.STRING) { + this.grantor = iprot.readString(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case TABLE: + if (field.type == TType.STRUCT) { + this.table = new Table(); + this.table.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case PART: + if (field.type == TType.STRUCT) { + this.part = new Partition(); + this.part.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); + break; + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + validate(); + } + + public void write(TProtocol oprot) throws TException { + validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (this.principalName != null) { + oprot.writeFieldBegin(PRINCIPAL_NAME_FIELD_DESC); + oprot.writeString(this.principalName); + oprot.writeFieldEnd(); + } + oprot.writeFieldBegin(IS_ROLE_FIELD_DESC); + oprot.writeBool(this.isRole); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(IS_GROUP_FIELD_DESC); + oprot.writeBool(this.isGroup); + oprot.writeFieldEnd(); + if (this.privileges != null) { + oprot.writeFieldBegin(PRIVILEGES_FIELD_DESC); + oprot.writeString(this.privileges); + oprot.writeFieldEnd(); + } + oprot.writeFieldBegin(CREATE_TIME_FIELD_DESC); + oprot.writeI32(this.createTime); + oprot.writeFieldEnd(); + if (this.grantor != null) { + oprot.writeFieldBegin(GRANTOR_FIELD_DESC); + oprot.writeString(this.grantor); + oprot.writeFieldEnd(); + } + if (this.table != null) { + oprot.writeFieldBegin(TABLE_FIELD_DESC); + this.table.write(oprot); + oprot.writeFieldEnd(); + } + if (this.part != null) { + oprot.writeFieldBegin(PART_FIELD_DESC); + this.part.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("SecurityTablePartition("); + boolean first = true; + + sb.append("principalName:"); + if (this.principalName == null) { + sb.append("null"); + } else { + sb.append(this.principalName); + } + first = false; + if (!first) sb.append(", "); + sb.append("isRole:"); + sb.append(this.isRole); + first = false; + if (!first) sb.append(", "); + sb.append("isGroup:"); + sb.append(this.isGroup); + first = false; + if (!first) sb.append(", "); + sb.append("privileges:"); + if (this.privileges == null) { + sb.append("null"); + } else { + sb.append(this.privileges); + } + first = false; + if (!first) sb.append(", "); + sb.append("createTime:"); + sb.append(this.createTime); + first = false; + if (!first) sb.append(", "); + sb.append("grantor:"); + if (this.grantor == null) { + sb.append("null"); + } else { + sb.append(this.grantor); + } + first = false; + if (!first) sb.append(", "); + sb.append("table:"); + if (this.table == null) { + sb.append("null"); + } else { + sb.append(this.table); + } + first = false; + if (!first) sb.append(", "); + sb.append("part:"); + if (this.part == null) { + sb.append("null"); + } else { + sb.append(this.part); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws TException { + // check for required fields + // check that fields of type enum have valid values + } + +} + Index: metastore/src/gen-javabean/org/apache/hadoop/hive/metastore/api/SecurityUser.java =================================================================== --- metastore/src/gen-javabean/org/apache/hadoop/hive/metastore/api/SecurityUser.java (revision 0) +++ metastore/src/gen-javabean/org/apache/hadoop/hive/metastore/api/SecurityUser.java (revision 0) @@ -0,0 +1,547 @@ +/** + * Autogenerated by Thrift + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + */ +package org.apache.hadoop.hive.metastore.api; + +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.Set; +import java.util.HashSet; +import java.util.Collections; +import org.apache.log4j.Logger; + +import org.apache.thrift.*; +import org.apache.thrift.meta_data.*; +import org.apache.thrift.protocol.*; + +public class SecurityUser implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("SecurityUser"); + private static final TField PRINCIPAL_NAME_FIELD_DESC = new TField("principalName", TType.STRING, (short)1); + private static final TField IS_ROLE_FIELD_DESC = new TField("isRole", TType.BOOL, (short)2); + private static final TField IS_GROUP_FIELD_DESC = new TField("isGroup", TType.BOOL, (short)3); + private static final TField PRIVILEGES_FIELD_DESC = new TField("privileges", TType.STRING, (short)4); + private static final TField CREATE_TIME_FIELD_DESC = new TField("createTime", TType.I32, (short)5); + private static final TField GRANTOR_FIELD_DESC = new TField("grantor", TType.STRING, (short)6); + + private String principalName; + public static final int PRINCIPALNAME = 1; + private boolean isRole; + public static final int ISROLE = 2; + private boolean isGroup; + public static final int ISGROUP = 3; + private String privileges; + public static final int PRIVILEGES = 4; + private int createTime; + public static final int CREATETIME = 5; + private String grantor; + public static final int GRANTOR = 6; + + private final Isset __isset = new Isset(); + private static final class Isset implements java.io.Serializable { + public boolean isRole = false; + public boolean isGroup = false; + public boolean createTime = false; + } + + public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ + put(PRINCIPALNAME, new FieldMetaData("principalName", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + put(ISROLE, new FieldMetaData("isRole", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.BOOL))); + put(ISGROUP, new FieldMetaData("isGroup", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.BOOL))); + put(PRIVILEGES, new FieldMetaData("privileges", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + put(CREATETIME, new FieldMetaData("createTime", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.I32))); + put(GRANTOR, new FieldMetaData("grantor", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + }}); + + static { + FieldMetaData.addStructMetaDataMap(SecurityUser.class, metaDataMap); + } + + public SecurityUser() { + } + + public SecurityUser( + String principalName, + boolean isRole, + boolean isGroup, + String privileges, + int createTime, + String grantor) + { + this(); + this.principalName = principalName; + this.isRole = isRole; + this.__isset.isRole = true; + this.isGroup = isGroup; + this.__isset.isGroup = true; + this.privileges = privileges; + this.createTime = createTime; + this.__isset.createTime = true; + this.grantor = grantor; + } + + /** + * Performs a deep copy on other. + */ + public SecurityUser(SecurityUser other) { + if (other.isSetPrincipalName()) { + this.principalName = other.principalName; + } + __isset.isRole = other.__isset.isRole; + this.isRole = other.isRole; + __isset.isGroup = other.__isset.isGroup; + this.isGroup = other.isGroup; + if (other.isSetPrivileges()) { + this.privileges = other.privileges; + } + __isset.createTime = other.__isset.createTime; + this.createTime = other.createTime; + if (other.isSetGrantor()) { + this.grantor = other.grantor; + } + } + + @Override + public SecurityUser clone() { + return new SecurityUser(this); + } + + public String getPrincipalName() { + return this.principalName; + } + + public void setPrincipalName(String principalName) { + this.principalName = principalName; + } + + public void unsetPrincipalName() { + this.principalName = null; + } + + // Returns true if field principalName is set (has been asigned a value) and false otherwise + public boolean isSetPrincipalName() { + return this.principalName != null; + } + + public boolean isIsRole() { + return this.isRole; + } + + public void setIsRole(boolean isRole) { + this.isRole = isRole; + this.__isset.isRole = true; + } + + public void unsetIsRole() { + this.__isset.isRole = false; + } + + // Returns true if field isRole is set (has been asigned a value) and false otherwise + public boolean isSetIsRole() { + return this.__isset.isRole; + } + + public boolean isIsGroup() { + return this.isGroup; + } + + public void setIsGroup(boolean isGroup) { + this.isGroup = isGroup; + this.__isset.isGroup = true; + } + + public void unsetIsGroup() { + this.__isset.isGroup = false; + } + + // Returns true if field isGroup is set (has been asigned a value) and false otherwise + public boolean isSetIsGroup() { + return this.__isset.isGroup; + } + + public String getPrivileges() { + return this.privileges; + } + + public void setPrivileges(String privileges) { + this.privileges = privileges; + } + + public void unsetPrivileges() { + this.privileges = null; + } + + // Returns true if field privileges is set (has been asigned a value) and false otherwise + public boolean isSetPrivileges() { + return this.privileges != null; + } + + public int getCreateTime() { + return this.createTime; + } + + public void setCreateTime(int createTime) { + this.createTime = createTime; + this.__isset.createTime = true; + } + + public void unsetCreateTime() { + this.__isset.createTime = false; + } + + // Returns true if field createTime is set (has been asigned a value) and false otherwise + public boolean isSetCreateTime() { + return this.__isset.createTime; + } + + public String getGrantor() { + return this.grantor; + } + + public void setGrantor(String grantor) { + this.grantor = grantor; + } + + public void unsetGrantor() { + this.grantor = null; + } + + // Returns true if field grantor is set (has been asigned a value) and false otherwise + public boolean isSetGrantor() { + return this.grantor != null; + } + + public void setFieldValue(int fieldID, Object value) { + switch (fieldID) { + case PRINCIPALNAME: + if (value == null) { + unsetPrincipalName(); + } else { + setPrincipalName((String)value); + } + break; + + case ISROLE: + if (value == null) { + unsetIsRole(); + } else { + setIsRole((Boolean)value); + } + break; + + case ISGROUP: + if (value == null) { + unsetIsGroup(); + } else { + setIsGroup((Boolean)value); + } + break; + + case PRIVILEGES: + if (value == null) { + unsetPrivileges(); + } else { + setPrivileges((String)value); + } + break; + + case CREATETIME: + if (value == null) { + unsetCreateTime(); + } else { + setCreateTime((Integer)value); + } + break; + + case GRANTOR: + if (value == null) { + unsetGrantor(); + } else { + setGrantor((String)value); + } + break; + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + public Object getFieldValue(int fieldID) { + switch (fieldID) { + case PRINCIPALNAME: + return getPrincipalName(); + + case ISROLE: + return new Boolean(isIsRole()); + + case ISGROUP: + return new Boolean(isIsGroup()); + + case PRIVILEGES: + return getPrivileges(); + + case CREATETIME: + return new Integer(getCreateTime()); + + case GRANTOR: + return getGrantor(); + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise + public boolean isSet(int fieldID) { + switch (fieldID) { + case PRINCIPALNAME: + return isSetPrincipalName(); + case ISROLE: + return isSetIsRole(); + case ISGROUP: + return isSetIsGroup(); + case PRIVILEGES: + return isSetPrivileges(); + case CREATETIME: + return isSetCreateTime(); + case GRANTOR: + return isSetGrantor(); + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof SecurityUser) + return this.equals((SecurityUser)that); + return false; + } + + public boolean equals(SecurityUser that) { + if (that == null) + return false; + + boolean this_present_principalName = true && this.isSetPrincipalName(); + boolean that_present_principalName = true && that.isSetPrincipalName(); + if (this_present_principalName || that_present_principalName) { + if (!(this_present_principalName && that_present_principalName)) + return false; + if (!this.principalName.equals(that.principalName)) + return false; + } + + boolean this_present_isRole = true; + boolean that_present_isRole = true; + if (this_present_isRole || that_present_isRole) { + if (!(this_present_isRole && that_present_isRole)) + return false; + if (this.isRole != that.isRole) + return false; + } + + boolean this_present_isGroup = true; + boolean that_present_isGroup = true; + if (this_present_isGroup || that_present_isGroup) { + if (!(this_present_isGroup && that_present_isGroup)) + return false; + if (this.isGroup != that.isGroup) + return false; + } + + boolean this_present_privileges = true && this.isSetPrivileges(); + boolean that_present_privileges = true && that.isSetPrivileges(); + if (this_present_privileges || that_present_privileges) { + if (!(this_present_privileges && that_present_privileges)) + return false; + if (!this.privileges.equals(that.privileges)) + return false; + } + + boolean this_present_createTime = true; + boolean that_present_createTime = true; + if (this_present_createTime || that_present_createTime) { + if (!(this_present_createTime && that_present_createTime)) + return false; + if (this.createTime != that.createTime) + return false; + } + + boolean this_present_grantor = true && this.isSetGrantor(); + boolean that_present_grantor = true && that.isSetGrantor(); + if (this_present_grantor || that_present_grantor) { + if (!(this_present_grantor && that_present_grantor)) + return false; + if (!this.grantor.equals(that.grantor)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + public void read(TProtocol iprot) throws TException { + TField field; + iprot.readStructBegin(); + while (true) + { + field = iprot.readFieldBegin(); + if (field.type == TType.STOP) { + break; + } + switch (field.id) + { + case PRINCIPALNAME: + if (field.type == TType.STRING) { + this.principalName = iprot.readString(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case ISROLE: + if (field.type == TType.BOOL) { + this.isRole = iprot.readBool(); + this.__isset.isRole = true; + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case ISGROUP: + if (field.type == TType.BOOL) { + this.isGroup = iprot.readBool(); + this.__isset.isGroup = true; + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case PRIVILEGES: + if (field.type == TType.STRING) { + this.privileges = iprot.readString(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case CREATETIME: + if (field.type == TType.I32) { + this.createTime = iprot.readI32(); + this.__isset.createTime = true; + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case GRANTOR: + if (field.type == TType.STRING) { + this.grantor = iprot.readString(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); + break; + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + validate(); + } + + public void write(TProtocol oprot) throws TException { + validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (this.principalName != null) { + oprot.writeFieldBegin(PRINCIPAL_NAME_FIELD_DESC); + oprot.writeString(this.principalName); + oprot.writeFieldEnd(); + } + oprot.writeFieldBegin(IS_ROLE_FIELD_DESC); + oprot.writeBool(this.isRole); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(IS_GROUP_FIELD_DESC); + oprot.writeBool(this.isGroup); + oprot.writeFieldEnd(); + if (this.privileges != null) { + oprot.writeFieldBegin(PRIVILEGES_FIELD_DESC); + oprot.writeString(this.privileges); + oprot.writeFieldEnd(); + } + oprot.writeFieldBegin(CREATE_TIME_FIELD_DESC); + oprot.writeI32(this.createTime); + oprot.writeFieldEnd(); + if (this.grantor != null) { + oprot.writeFieldBegin(GRANTOR_FIELD_DESC); + oprot.writeString(this.grantor); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("SecurityUser("); + boolean first = true; + + sb.append("principalName:"); + if (this.principalName == null) { + sb.append("null"); + } else { + sb.append(this.principalName); + } + first = false; + if (!first) sb.append(", "); + sb.append("isRole:"); + sb.append(this.isRole); + first = false; + if (!first) sb.append(", "); + sb.append("isGroup:"); + sb.append(this.isGroup); + first = false; + if (!first) sb.append(", "); + sb.append("privileges:"); + if (this.privileges == null) { + sb.append("null"); + } else { + sb.append(this.privileges); + } + first = false; + if (!first) sb.append(", "); + sb.append("createTime:"); + sb.append(this.createTime); + first = false; + if (!first) sb.append(", "); + sb.append("grantor:"); + if (this.grantor == null) { + sb.append("null"); + } else { + sb.append(this.grantor); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws TException { + // check for required fields + // check that fields of type enum have valid values + } + +} + Index: metastore/src/gen-javabean/org/apache/hadoop/hive/metastore/api/SerDeInfo.java =================================================================== --- metastore/src/gen-javabean/org/apache/hadoop/hive/metastore/api/SerDeInfo.java (revision 1030336) +++ metastore/src/gen-javabean/org/apache/hadoop/hive/metastore/api/SerDeInfo.java (working copy) @@ -295,15 +295,15 @@ case PARAMETERS: if (field.type == TType.MAP) { { - TMap _map4 = iprot.readMapBegin(); - this.parameters = new HashMap(2*_map4.size); - for (int _i5 = 0; _i5 < _map4.size; ++_i5) + TMap _map19 = iprot.readMapBegin(); + this.parameters = new HashMap(2*_map19.size); + for (int _i20 = 0; _i20 < _map19.size; ++_i20) { - String _key6; - String _val7; - _key6 = iprot.readString(); - _val7 = iprot.readString(); - this.parameters.put(_key6, _val7); + String _key21; + String _val22; + _key21 = iprot.readString(); + _val22 = iprot.readString(); + this.parameters.put(_key21, _val22); } iprot.readMapEnd(); } @@ -340,9 +340,9 @@ oprot.writeFieldBegin(PARAMETERS_FIELD_DESC); { oprot.writeMapBegin(new TMap(TType.STRING, TType.STRING, this.parameters.size())); - for (Map.Entry _iter8 : this.parameters.entrySet()) { - oprot.writeString(_iter8.getKey()); - oprot.writeString(_iter8.getValue()); + for (Map.Entry _iter23 : this.parameters.entrySet()) { + oprot.writeString(_iter23.getKey()); + oprot.writeString(_iter23.getValue()); } oprot.writeMapEnd(); } Index: metastore/src/gen-javabean/org/apache/hadoop/hive/metastore/api/StorageDescriptor.java =================================================================== --- metastore/src/gen-javabean/org/apache/hadoop/hive/metastore/api/StorageDescriptor.java (revision 1030336) +++ metastore/src/gen-javabean/org/apache/hadoop/hive/metastore/api/StorageDescriptor.java (working copy) @@ -688,14 +688,14 @@ case COLS: if (field.type == TType.LIST) { { - TList _list9 = iprot.readListBegin(); - this.cols = new ArrayList(_list9.size); - for (int _i10 = 0; _i10 < _list9.size; ++_i10) + TList _list24 = iprot.readListBegin(); + this.cols = new ArrayList(_list24.size); + for (int _i25 = 0; _i25 < _list24.size; ++_i25) { - FieldSchema _elem11; - _elem11 = new FieldSchema(); - _elem11.read(iprot); - this.cols.add(_elem11); + FieldSchema _elem26; + _elem26 = new FieldSchema(); + _elem26.read(iprot); + this.cols.add(_elem26); } iprot.readListEnd(); } @@ -751,13 +751,13 @@ case BUCKETCOLS: if (field.type == TType.LIST) { { - TList _list12 = iprot.readListBegin(); - this.bucketCols = new ArrayList(_list12.size); - for (int _i13 = 0; _i13 < _list12.size; ++_i13) + TList _list27 = iprot.readListBegin(); + this.bucketCols = new ArrayList(_list27.size); + for (int _i28 = 0; _i28 < _list27.size; ++_i28) { - String _elem14; - _elem14 = iprot.readString(); - this.bucketCols.add(_elem14); + String _elem29; + _elem29 = iprot.readString(); + this.bucketCols.add(_elem29); } iprot.readListEnd(); } @@ -768,14 +768,14 @@ case SORTCOLS: if (field.type == TType.LIST) { { - TList _list15 = iprot.readListBegin(); - this.sortCols = new ArrayList(_list15.size); - for (int _i16 = 0; _i16 < _list15.size; ++_i16) + TList _list30 = iprot.readListBegin(); + this.sortCols = new ArrayList(_list30.size); + for (int _i31 = 0; _i31 < _list30.size; ++_i31) { - Order _elem17; - _elem17 = new Order(); - _elem17.read(iprot); - this.sortCols.add(_elem17); + Order _elem32; + _elem32 = new Order(); + _elem32.read(iprot); + this.sortCols.add(_elem32); } iprot.readListEnd(); } @@ -786,15 +786,15 @@ case PARAMETERS: if (field.type == TType.MAP) { { - TMap _map18 = iprot.readMapBegin(); - this.parameters = new HashMap(2*_map18.size); - for (int _i19 = 0; _i19 < _map18.size; ++_i19) + TMap _map33 = iprot.readMapBegin(); + this.parameters = new HashMap(2*_map33.size); + for (int _i34 = 0; _i34 < _map33.size; ++_i34) { - String _key20; - String _val21; - _key20 = iprot.readString(); - _val21 = iprot.readString(); - this.parameters.put(_key20, _val21); + String _key35; + String _val36; + _key35 = iprot.readString(); + _val36 = iprot.readString(); + this.parameters.put(_key35, _val36); } iprot.readMapEnd(); } @@ -821,8 +821,8 @@ oprot.writeFieldBegin(COLS_FIELD_DESC); { oprot.writeListBegin(new TList(TType.STRUCT, this.cols.size())); - for (FieldSchema _iter22 : this.cols) { - _iter22.write(oprot); + for (FieldSchema _iter37 : this.cols) { + _iter37.write(oprot); } oprot.writeListEnd(); } @@ -858,8 +858,8 @@ oprot.writeFieldBegin(BUCKET_COLS_FIELD_DESC); { oprot.writeListBegin(new TList(TType.STRING, this.bucketCols.size())); - for (String _iter23 : this.bucketCols) { - oprot.writeString(_iter23); + for (String _iter38 : this.bucketCols) { + oprot.writeString(_iter38); } oprot.writeListEnd(); } @@ -869,8 +869,8 @@ oprot.writeFieldBegin(SORT_COLS_FIELD_DESC); { oprot.writeListBegin(new TList(TType.STRUCT, this.sortCols.size())); - for (Order _iter24 : this.sortCols) { - _iter24.write(oprot); + for (Order _iter39 : this.sortCols) { + _iter39.write(oprot); } oprot.writeListEnd(); } @@ -880,9 +880,9 @@ oprot.writeFieldBegin(PARAMETERS_FIELD_DESC); { oprot.writeMapBegin(new TMap(TType.STRING, TType.STRING, this.parameters.size())); - for (Map.Entry _iter25 : this.parameters.entrySet()) { - oprot.writeString(_iter25.getKey()); - oprot.writeString(_iter25.getValue()); + for (Map.Entry _iter40 : this.parameters.entrySet()) { + oprot.writeString(_iter40.getKey()); + oprot.writeString(_iter40.getValue()); } oprot.writeMapEnd(); } Index: metastore/src/gen-javabean/org/apache/hadoop/hive/metastore/api/Table.java =================================================================== --- metastore/src/gen-javabean/org/apache/hadoop/hive/metastore/api/Table.java (revision 1030336) +++ metastore/src/gen-javabean/org/apache/hadoop/hive/metastore/api/Table.java (working copy) @@ -32,6 +32,7 @@ private static final TField VIEW_ORIGINAL_TEXT_FIELD_DESC = new TField("viewOriginalText", TType.STRING, (short)10); private static final TField VIEW_EXPANDED_TEXT_FIELD_DESC = new TField("viewExpandedText", TType.STRING, (short)11); private static final TField TABLE_TYPE_FIELD_DESC = new TField("tableType", TType.STRING, (short)12); + private static final TField PRIVILEGES_FIELD_DESC = new TField("privileges", TType.STRUCT, (short)13); private String tableName; public static final int TABLENAME = 1; @@ -57,6 +58,8 @@ public static final int VIEWEXPANDEDTEXT = 11; private String tableType; public static final int TABLETYPE = 12; + private PrincipalPrivilegeSet privileges; + public static final int PRIVILEGES = 13; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { @@ -93,6 +96,8 @@ new FieldValueMetaData(TType.STRING))); put(TABLETYPE, new FieldMetaData("tableType", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRING))); + put(PRIVILEGES, new FieldMetaData("privileges", TFieldRequirementType.OPTIONAL, + new StructMetaData(TType.STRUCT, PrincipalPrivilegeSet.class))); }}); static { @@ -114,7 +119,8 @@ Map parameters, String viewOriginalText, String viewExpandedText, - String tableType) + String tableType, + PrincipalPrivilegeSet privileges) { this(); this.tableName = tableName; @@ -132,6 +138,7 @@ this.viewOriginalText = viewOriginalText; this.viewExpandedText = viewExpandedText; this.tableType = tableType; + this.privileges = privileges; } /** @@ -187,6 +194,9 @@ if (other.isSetTableType()) { this.tableType = other.tableType; } + if (other.isSetPrivileges()) { + this.privileges = new PrincipalPrivilegeSet(other.privileges); + } } @Override @@ -427,6 +437,23 @@ return this.tableType != null; } + public PrincipalPrivilegeSet getPrivileges() { + return this.privileges; + } + + public void setPrivileges(PrincipalPrivilegeSet privileges) { + this.privileges = privileges; + } + + public void unsetPrivileges() { + this.privileges = null; + } + + // Returns true if field privileges is set (has been asigned a value) and false otherwise + public boolean isSetPrivileges() { + return this.privileges != null; + } + public void setFieldValue(int fieldID, Object value) { switch (fieldID) { case TABLENAME: @@ -525,6 +552,14 @@ } break; + case PRIVILEGES: + if (value == null) { + unsetPrivileges(); + } else { + setPrivileges((PrincipalPrivilegeSet)value); + } + break; + default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -568,6 +603,9 @@ case TABLETYPE: return getTableType(); + case PRIVILEGES: + return getPrivileges(); + default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -600,6 +638,8 @@ return isSetViewExpandedText(); case TABLETYPE: return isSetTableType(); + case PRIVILEGES: + return isSetPrivileges(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -726,6 +766,15 @@ return false; } + boolean this_present_privileges = true && this.isSetPrivileges(); + boolean that_present_privileges = true && that.isSetPrivileges(); + if (this_present_privileges || that_present_privileges) { + if (!(this_present_privileges && that_present_privileges)) + return false; + if (!this.privileges.equals(that.privileges)) + return false; + } + return true; } @@ -801,14 +850,14 @@ case PARTITIONKEYS: if (field.type == TType.LIST) { { - TList _list26 = iprot.readListBegin(); - this.partitionKeys = new ArrayList(_list26.size); - for (int _i27 = 0; _i27 < _list26.size; ++_i27) + TList _list41 = iprot.readListBegin(); + this.partitionKeys = new ArrayList(_list41.size); + for (int _i42 = 0; _i42 < _list41.size; ++_i42) { - FieldSchema _elem28; - _elem28 = new FieldSchema(); - _elem28.read(iprot); - this.partitionKeys.add(_elem28); + FieldSchema _elem43; + _elem43 = new FieldSchema(); + _elem43.read(iprot); + this.partitionKeys.add(_elem43); } iprot.readListEnd(); } @@ -819,15 +868,15 @@ case PARAMETERS: if (field.type == TType.MAP) { { - TMap _map29 = iprot.readMapBegin(); - this.parameters = new HashMap(2*_map29.size); - for (int _i30 = 0; _i30 < _map29.size; ++_i30) + TMap _map44 = iprot.readMapBegin(); + this.parameters = new HashMap(2*_map44.size); + for (int _i45 = 0; _i45 < _map44.size; ++_i45) { - String _key31; - String _val32; - _key31 = iprot.readString(); - _val32 = iprot.readString(); - this.parameters.put(_key31, _val32); + String _key46; + String _val47; + _key46 = iprot.readString(); + _val47 = iprot.readString(); + this.parameters.put(_key46, _val47); } iprot.readMapEnd(); } @@ -856,6 +905,14 @@ TProtocolUtil.skip(iprot, field.type); } break; + case PRIVILEGES: + if (field.type == TType.STRUCT) { + this.privileges = new PrincipalPrivilegeSet(); + this.privileges.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; default: TProtocolUtil.skip(iprot, field.type); break; @@ -904,8 +961,8 @@ oprot.writeFieldBegin(PARTITION_KEYS_FIELD_DESC); { oprot.writeListBegin(new TList(TType.STRUCT, this.partitionKeys.size())); - for (FieldSchema _iter33 : this.partitionKeys) { - _iter33.write(oprot); + for (FieldSchema _iter48 : this.partitionKeys) { + _iter48.write(oprot); } oprot.writeListEnd(); } @@ -915,9 +972,9 @@ oprot.writeFieldBegin(PARAMETERS_FIELD_DESC); { oprot.writeMapBegin(new TMap(TType.STRING, TType.STRING, this.parameters.size())); - for (Map.Entry _iter34 : this.parameters.entrySet()) { - oprot.writeString(_iter34.getKey()); - oprot.writeString(_iter34.getValue()); + for (Map.Entry _iter49 : this.parameters.entrySet()) { + oprot.writeString(_iter49.getKey()); + oprot.writeString(_iter49.getValue()); } oprot.writeMapEnd(); } @@ -938,6 +995,13 @@ oprot.writeString(this.tableType); oprot.writeFieldEnd(); } + if (this.privileges != null) { + if (isSetPrivileges()) { + oprot.writeFieldBegin(PRIVILEGES_FIELD_DESC); + this.privileges.write(oprot); + oprot.writeFieldEnd(); + } + } oprot.writeFieldStop(); oprot.writeStructEnd(); } @@ -1030,6 +1094,16 @@ sb.append(this.tableType); } first = false; + if (isSetPrivileges()) { + if (!first) sb.append(", "); + sb.append("privileges:"); + if (this.privileges == null) { + sb.append("null"); + } else { + sb.append(this.privileges); + } + first = false; + } sb.append(")"); return sb.toString(); } Index: metastore/src/gen-javabean/org/apache/hadoop/hive/metastore/api/ThriftHiveMetastore.java =================================================================== --- metastore/src/gen-javabean/org/apache/hadoop/hive/metastore/api/ThriftHiveMetastore.java (revision 1030336) +++ metastore/src/gen-javabean/org/apache/hadoop/hive/metastore/api/ThriftHiveMetastore.java (working copy) @@ -101,6 +101,40 @@ public List get_index_names(String db_name, String tbl_name, short max_indexes) throws MetaException, TException; + public PrincipalPrivilegeSet get_user_privilege_set(String user_name, List group_names) throws MetaException, TException; + + public PrincipalPrivilegeSet get_db_privilege_set(String db_name, String user_name, List group_names) throws MetaException, TException; + + public PrincipalPrivilegeSet get_table_privilege_set(String db_name, String table_name, String user_name, List group_names) throws MetaException, TException; + + public PrincipalPrivilegeSet get_partition_privilege_set(String db_name, String table_name, String part_name, String user_name, List group_names) throws MetaException, TException; + + public PrincipalPrivilegeSet get_column_privilege_set(String db_name, String table_name, String part_name, String column_name, String user_name, List group_names) throws MetaException, TException; + + public boolean create_role(String role_name, String owner_name) throws MetaException, TException; + + public boolean drop_role(String role_name) throws MetaException, TException; + + public boolean add_role_member(String role_name, String user_name, boolean is_role, boolean is_group) throws MetaException, TException; + + public boolean remove_role_member(String role_name, String user_name, boolean is_role, boolean is_group) throws MetaException, TException; + + public List list_security_user_grant(String principal_name, boolean is_role, boolean is_group) throws MetaException, TException; + + public List list_security_db_grant(String principal_name, boolean is_group, boolean is_role, String db_name) throws MetaException, TException; + + public List list_security_table_grant(String principal_name, boolean is_group, boolean is_role, String db_name, String table_name) throws MetaException, TException; + + public List list_security_partition_grant(String principal_name, boolean is_group, boolean is_role, String db_name, String table_name, String part_name) throws MetaException, TException; + + public List list_security_column_grant(String principal_name, boolean is_group, boolean is_role, String db_name, String table_name, String column_name) throws MetaException, TException; + + public boolean grant_privileges(String user_name, boolean is_role, boolean is_group, PrivilegeBag privileges, String grantor) throws MetaException, TException; + + public boolean revoke_privileges(String user_name, boolean is_role, boolean is_group, PrivilegeBag privileges) throws MetaException, TException; + + public boolean revoke_all_privileges(String user_name, boolean is_role, boolean is_group, boolean remove_user_priv, List dbs, List
tables, List parts, Map> columns) throws MetaException, TException; + } public static class Client extends com.facebook.fb303.FacebookService.Client implements Iface { @@ -1623,1286 +1657,12559 @@ throw new TApplicationException(TApplicationException.MISSING_RESULT, "get_index_names failed: unknown result"); } - } - public static class Processor extends com.facebook.fb303.FacebookService.Processor implements TProcessor { - private static final Logger LOGGER = Logger.getLogger(Processor.class.getName()); - public Processor(Iface iface) + public PrincipalPrivilegeSet get_user_privilege_set(String user_name, List group_names) throws MetaException, TException { - super(iface); - iface_ = iface; - processMap_.put("create_database", new create_database()); - processMap_.put("get_database", new get_database()); - processMap_.put("drop_database", new drop_database()); - processMap_.put("get_databases", new get_databases()); - processMap_.put("get_all_databases", new get_all_databases()); - processMap_.put("get_type", new get_type()); - processMap_.put("create_type", new create_type()); - processMap_.put("drop_type", new drop_type()); - processMap_.put("get_type_all", new get_type_all()); - processMap_.put("get_fields", new get_fields()); - processMap_.put("get_schema", new get_schema()); - processMap_.put("create_table", new create_table()); - processMap_.put("drop_table", new drop_table()); - processMap_.put("get_tables", new get_tables()); - processMap_.put("get_all_tables", new get_all_tables()); - processMap_.put("get_table", new get_table()); - processMap_.put("alter_table", new alter_table()); - processMap_.put("add_partition", new add_partition()); - processMap_.put("append_partition", new append_partition()); - processMap_.put("append_partition_by_name", new append_partition_by_name()); - processMap_.put("drop_partition", new drop_partition()); - processMap_.put("drop_partition_by_name", new drop_partition_by_name()); - processMap_.put("get_partition", new get_partition()); - processMap_.put("get_partition_by_name", new get_partition_by_name()); - processMap_.put("get_partitions", new get_partitions()); - processMap_.put("get_partition_names", new get_partition_names()); - processMap_.put("get_partitions_ps", new get_partitions_ps()); - processMap_.put("get_partition_names_ps", new get_partition_names_ps()); - processMap_.put("get_partitions_by_filter", new get_partitions_by_filter()); - processMap_.put("alter_partition", new alter_partition()); - processMap_.put("get_config_value", new get_config_value()); - processMap_.put("partition_name_to_vals", new partition_name_to_vals()); - processMap_.put("partition_name_to_spec", new partition_name_to_spec()); - processMap_.put("add_index", new add_index()); - processMap_.put("drop_index_by_name", new drop_index_by_name()); - processMap_.put("get_index_by_name", new get_index_by_name()); - processMap_.put("get_indexes", new get_indexes()); - processMap_.put("get_index_names", new get_index_names()); + send_get_user_privilege_set(user_name, group_names); + return recv_get_user_privilege_set(); } - private Iface iface_; + public void send_get_user_privilege_set(String user_name, List group_names) throws TException + { + oprot_.writeMessageBegin(new TMessage("get_user_privilege_set", TMessageType.CALL, seqid_)); + get_user_privilege_set_args args = new get_user_privilege_set_args(); + args.user_name = user_name; + args.group_names = group_names; + args.write(oprot_); + oprot_.writeMessageEnd(); + oprot_.getTransport().flush(); + } - public boolean process(TProtocol iprot, TProtocol oprot) throws TException + public PrincipalPrivilegeSet recv_get_user_privilege_set() throws MetaException, TException { - TMessage msg = iprot.readMessageBegin(); - ProcessFunction fn = processMap_.get(msg.name); - if (fn == null) { - TProtocolUtil.skip(iprot, TType.STRUCT); - iprot.readMessageEnd(); - TApplicationException x = new TApplicationException(TApplicationException.UNKNOWN_METHOD, "Invalid method name: '"+msg.name+"'"); - oprot.writeMessageBegin(new TMessage(msg.name, TMessageType.EXCEPTION, msg.seqid)); - x.write(oprot); - oprot.writeMessageEnd(); - oprot.getTransport().flush(); - return true; + TMessage msg = iprot_.readMessageBegin(); + if (msg.type == TMessageType.EXCEPTION) { + TApplicationException x = TApplicationException.read(iprot_); + iprot_.readMessageEnd(); + throw x; } - fn.process(msg.seqid, iprot, oprot); - return true; + get_user_privilege_set_result result = new get_user_privilege_set_result(); + result.read(iprot_); + iprot_.readMessageEnd(); + if (result.isSetSuccess()) { + return result.success; + } + if (result.o1 != null) { + throw result.o1; + } + throw new TApplicationException(TApplicationException.MISSING_RESULT, "get_user_privilege_set failed: unknown result"); } - private class create_database implements ProcessFunction { - public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException - { - create_database_args args = new create_database_args(); - args.read(iprot); - iprot.readMessageEnd(); - create_database_result result = new create_database_result(); - try { - iface_.create_database(args.database); - } catch (AlreadyExistsException o1) { - result.o1 = o1; - } catch (InvalidObjectException o2) { - result.o2 = o2; - } catch (MetaException o3) { - result.o3 = o3; - } catch (Throwable th) { - LOGGER.error("Internal error processing create_database", th); - TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing create_database"); - oprot.writeMessageBegin(new TMessage("create_database", TMessageType.EXCEPTION, seqid)); - x.write(oprot); - oprot.writeMessageEnd(); - oprot.getTransport().flush(); - return; - } - oprot.writeMessageBegin(new TMessage("create_database", TMessageType.REPLY, seqid)); - result.write(oprot); - oprot.writeMessageEnd(); - oprot.getTransport().flush(); - } + public PrincipalPrivilegeSet get_db_privilege_set(String db_name, String user_name, List group_names) throws MetaException, TException + { + send_get_db_privilege_set(db_name, user_name, group_names); + return recv_get_db_privilege_set(); + } + public void send_get_db_privilege_set(String db_name, String user_name, List group_names) throws TException + { + oprot_.writeMessageBegin(new TMessage("get_db_privilege_set", TMessageType.CALL, seqid_)); + get_db_privilege_set_args args = new get_db_privilege_set_args(); + args.db_name = db_name; + args.user_name = user_name; + args.group_names = group_names; + args.write(oprot_); + oprot_.writeMessageEnd(); + oprot_.getTransport().flush(); } - private class get_database implements ProcessFunction { - public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException - { - get_database_args args = new get_database_args(); - args.read(iprot); - iprot.readMessageEnd(); - get_database_result result = new get_database_result(); - try { - result.success = iface_.get_database(args.name); - } catch (NoSuchObjectException o1) { - result.o1 = o1; - } catch (MetaException o2) { - result.o2 = o2; - } catch (Throwable th) { - LOGGER.error("Internal error processing get_database", th); - TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing get_database"); - oprot.writeMessageBegin(new TMessage("get_database", TMessageType.EXCEPTION, seqid)); - x.write(oprot); - oprot.writeMessageEnd(); - oprot.getTransport().flush(); - return; - } - oprot.writeMessageBegin(new TMessage("get_database", TMessageType.REPLY, seqid)); - result.write(oprot); - oprot.writeMessageEnd(); - oprot.getTransport().flush(); + public PrincipalPrivilegeSet recv_get_db_privilege_set() throws MetaException, TException + { + TMessage msg = iprot_.readMessageBegin(); + if (msg.type == TMessageType.EXCEPTION) { + TApplicationException x = TApplicationException.read(iprot_); + iprot_.readMessageEnd(); + throw x; } - + get_db_privilege_set_result result = new get_db_privilege_set_result(); + result.read(iprot_); + iprot_.readMessageEnd(); + if (result.isSetSuccess()) { + return result.success; + } + if (result.o1 != null) { + throw result.o1; + } + throw new TApplicationException(TApplicationException.MISSING_RESULT, "get_db_privilege_set failed: unknown result"); } - private class drop_database implements ProcessFunction { - public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException - { - drop_database_args args = new drop_database_args(); - args.read(iprot); - iprot.readMessageEnd(); - drop_database_result result = new drop_database_result(); - try { - iface_.drop_database(args.name, args.deleteData); - } catch (NoSuchObjectException o1) { - result.o1 = o1; - } catch (InvalidOperationException o2) { - result.o2 = o2; - } catch (MetaException o3) { - result.o3 = o3; - } catch (Throwable th) { - LOGGER.error("Internal error processing drop_database", th); - TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing drop_database"); - oprot.writeMessageBegin(new TMessage("drop_database", TMessageType.EXCEPTION, seqid)); - x.write(oprot); - oprot.writeMessageEnd(); - oprot.getTransport().flush(); - return; - } - oprot.writeMessageBegin(new TMessage("drop_database", TMessageType.REPLY, seqid)); - result.write(oprot); - oprot.writeMessageEnd(); - oprot.getTransport().flush(); - } + public PrincipalPrivilegeSet get_table_privilege_set(String db_name, String table_name, String user_name, List group_names) throws MetaException, TException + { + send_get_table_privilege_set(db_name, table_name, user_name, group_names); + return recv_get_table_privilege_set(); + } + public void send_get_table_privilege_set(String db_name, String table_name, String user_name, List group_names) throws TException + { + oprot_.writeMessageBegin(new TMessage("get_table_privilege_set", TMessageType.CALL, seqid_)); + get_table_privilege_set_args args = new get_table_privilege_set_args(); + args.db_name = db_name; + args.table_name = table_name; + args.user_name = user_name; + args.group_names = group_names; + args.write(oprot_); + oprot_.writeMessageEnd(); + oprot_.getTransport().flush(); + } + + public PrincipalPrivilegeSet recv_get_table_privilege_set() throws MetaException, TException + { + TMessage msg = iprot_.readMessageBegin(); + if (msg.type == TMessageType.EXCEPTION) { + TApplicationException x = TApplicationException.read(iprot_); + iprot_.readMessageEnd(); + throw x; + } + get_table_privilege_set_result result = new get_table_privilege_set_result(); + result.read(iprot_); + iprot_.readMessageEnd(); + if (result.isSetSuccess()) { + return result.success; + } + if (result.o1 != null) { + throw result.o1; + } + throw new TApplicationException(TApplicationException.MISSING_RESULT, "get_table_privilege_set failed: unknown result"); + } + + public PrincipalPrivilegeSet get_partition_privilege_set(String db_name, String table_name, String part_name, String user_name, List group_names) throws MetaException, TException + { + send_get_partition_privilege_set(db_name, table_name, part_name, user_name, group_names); + return recv_get_partition_privilege_set(); + } + + public void send_get_partition_privilege_set(String db_name, String table_name, String part_name, String user_name, List group_names) throws TException + { + oprot_.writeMessageBegin(new TMessage("get_partition_privilege_set", TMessageType.CALL, seqid_)); + get_partition_privilege_set_args args = new get_partition_privilege_set_args(); + args.db_name = db_name; + args.table_name = table_name; + args.part_name = part_name; + args.user_name = user_name; + args.group_names = group_names; + args.write(oprot_); + oprot_.writeMessageEnd(); + oprot_.getTransport().flush(); + } + + public PrincipalPrivilegeSet recv_get_partition_privilege_set() throws MetaException, TException + { + TMessage msg = iprot_.readMessageBegin(); + if (msg.type == TMessageType.EXCEPTION) { + TApplicationException x = TApplicationException.read(iprot_); + iprot_.readMessageEnd(); + throw x; + } + get_partition_privilege_set_result result = new get_partition_privilege_set_result(); + result.read(iprot_); + iprot_.readMessageEnd(); + if (result.isSetSuccess()) { + return result.success; + } + if (result.o1 != null) { + throw result.o1; + } + throw new TApplicationException(TApplicationException.MISSING_RESULT, "get_partition_privilege_set failed: unknown result"); + } + + public PrincipalPrivilegeSet get_column_privilege_set(String db_name, String table_name, String part_name, String column_name, String user_name, List group_names) throws MetaException, TException + { + send_get_column_privilege_set(db_name, table_name, part_name, column_name, user_name, group_names); + return recv_get_column_privilege_set(); + } + + public void send_get_column_privilege_set(String db_name, String table_name, String part_name, String column_name, String user_name, List group_names) throws TException + { + oprot_.writeMessageBegin(new TMessage("get_column_privilege_set", TMessageType.CALL, seqid_)); + get_column_privilege_set_args args = new get_column_privilege_set_args(); + args.db_name = db_name; + args.table_name = table_name; + args.part_name = part_name; + args.column_name = column_name; + args.user_name = user_name; + args.group_names = group_names; + args.write(oprot_); + oprot_.writeMessageEnd(); + oprot_.getTransport().flush(); + } + + public PrincipalPrivilegeSet recv_get_column_privilege_set() throws MetaException, TException + { + TMessage msg = iprot_.readMessageBegin(); + if (msg.type == TMessageType.EXCEPTION) { + TApplicationException x = TApplicationException.read(iprot_); + iprot_.readMessageEnd(); + throw x; + } + get_column_privilege_set_result result = new get_column_privilege_set_result(); + result.read(iprot_); + iprot_.readMessageEnd(); + if (result.isSetSuccess()) { + return result.success; + } + if (result.o1 != null) { + throw result.o1; + } + throw new TApplicationException(TApplicationException.MISSING_RESULT, "get_column_privilege_set failed: unknown result"); + } + + public boolean create_role(String role_name, String owner_name) throws MetaException, TException + { + send_create_role(role_name, owner_name); + return recv_create_role(); + } + + public void send_create_role(String role_name, String owner_name) throws TException + { + oprot_.writeMessageBegin(new TMessage("create_role", TMessageType.CALL, seqid_)); + create_role_args args = new create_role_args(); + args.role_name = role_name; + args.owner_name = owner_name; + args.write(oprot_); + oprot_.writeMessageEnd(); + oprot_.getTransport().flush(); + } + + public boolean recv_create_role() throws MetaException, TException + { + TMessage msg = iprot_.readMessageBegin(); + if (msg.type == TMessageType.EXCEPTION) { + TApplicationException x = TApplicationException.read(iprot_); + iprot_.readMessageEnd(); + throw x; + } + create_role_result result = new create_role_result(); + result.read(iprot_); + iprot_.readMessageEnd(); + if (result.isSetSuccess()) { + return result.success; + } + if (result.o1 != null) { + throw result.o1; + } + throw new TApplicationException(TApplicationException.MISSING_RESULT, "create_role failed: unknown result"); + } + + public boolean drop_role(String role_name) throws MetaException, TException + { + send_drop_role(role_name); + return recv_drop_role(); + } + + public void send_drop_role(String role_name) throws TException + { + oprot_.writeMessageBegin(new TMessage("drop_role", TMessageType.CALL, seqid_)); + drop_role_args args = new drop_role_args(); + args.role_name = role_name; + args.write(oprot_); + oprot_.writeMessageEnd(); + oprot_.getTransport().flush(); + } + + public boolean recv_drop_role() throws MetaException, TException + { + TMessage msg = iprot_.readMessageBegin(); + if (msg.type == TMessageType.EXCEPTION) { + TApplicationException x = TApplicationException.read(iprot_); + iprot_.readMessageEnd(); + throw x; + } + drop_role_result result = new drop_role_result(); + result.read(iprot_); + iprot_.readMessageEnd(); + if (result.isSetSuccess()) { + return result.success; + } + if (result.o1 != null) { + throw result.o1; + } + throw new TApplicationException(TApplicationException.MISSING_RESULT, "drop_role failed: unknown result"); + } + + public boolean add_role_member(String role_name, String user_name, boolean is_role, boolean is_group) throws MetaException, TException + { + send_add_role_member(role_name, user_name, is_role, is_group); + return recv_add_role_member(); + } + + public void send_add_role_member(String role_name, String user_name, boolean is_role, boolean is_group) throws TException + { + oprot_.writeMessageBegin(new TMessage("add_role_member", TMessageType.CALL, seqid_)); + add_role_member_args args = new add_role_member_args(); + args.role_name = role_name; + args.user_name = user_name; + args.is_role = is_role; + args.is_group = is_group; + args.write(oprot_); + oprot_.writeMessageEnd(); + oprot_.getTransport().flush(); + } + + public boolean recv_add_role_member() throws MetaException, TException + { + TMessage msg = iprot_.readMessageBegin(); + if (msg.type == TMessageType.EXCEPTION) { + TApplicationException x = TApplicationException.read(iprot_); + iprot_.readMessageEnd(); + throw x; + } + add_role_member_result result = new add_role_member_result(); + result.read(iprot_); + iprot_.readMessageEnd(); + if (result.isSetSuccess()) { + return result.success; + } + if (result.o1 != null) { + throw result.o1; + } + throw new TApplicationException(TApplicationException.MISSING_RESULT, "add_role_member failed: unknown result"); + } + + public boolean remove_role_member(String role_name, String user_name, boolean is_role, boolean is_group) throws MetaException, TException + { + send_remove_role_member(role_name, user_name, is_role, is_group); + return recv_remove_role_member(); + } + + public void send_remove_role_member(String role_name, String user_name, boolean is_role, boolean is_group) throws TException + { + oprot_.writeMessageBegin(new TMessage("remove_role_member", TMessageType.CALL, seqid_)); + remove_role_member_args args = new remove_role_member_args(); + args.role_name = role_name; + args.user_name = user_name; + args.is_role = is_role; + args.is_group = is_group; + args.write(oprot_); + oprot_.writeMessageEnd(); + oprot_.getTransport().flush(); + } + + public boolean recv_remove_role_member() throws MetaException, TException + { + TMessage msg = iprot_.readMessageBegin(); + if (msg.type == TMessageType.EXCEPTION) { + TApplicationException x = TApplicationException.read(iprot_); + iprot_.readMessageEnd(); + throw x; + } + remove_role_member_result result = new remove_role_member_result(); + result.read(iprot_); + iprot_.readMessageEnd(); + if (result.isSetSuccess()) { + return result.success; + } + if (result.o1 != null) { + throw result.o1; + } + throw new TApplicationException(TApplicationException.MISSING_RESULT, "remove_role_member failed: unknown result"); + } + + public List list_security_user_grant(String principla_name, boolean is_role, boolean is_group) throws MetaException, TException + { + send_list_security_user_grant(principla_name, is_role, is_group); + return recv_list_security_user_grant(); + } + + public void send_list_security_user_grant(String principla_name, boolean is_role, boolean is_group) throws TException + { + oprot_.writeMessageBegin(new TMessage("list_security_user_grant", TMessageType.CALL, seqid_)); + list_security_user_grant_args args = new list_security_user_grant_args(); + args.principla_name = principla_name; + args.is_role = is_role; + args.is_group = is_group; + args.write(oprot_); + oprot_.writeMessageEnd(); + oprot_.getTransport().flush(); + } + + public List recv_list_security_user_grant() throws MetaException, TException + { + TMessage msg = iprot_.readMessageBegin(); + if (msg.type == TMessageType.EXCEPTION) { + TApplicationException x = TApplicationException.read(iprot_); + iprot_.readMessageEnd(); + throw x; + } + list_security_user_grant_result result = new list_security_user_grant_result(); + result.read(iprot_); + iprot_.readMessageEnd(); + if (result.isSetSuccess()) { + return result.success; + } + if (result.o1 != null) { + throw result.o1; + } + throw new TApplicationException(TApplicationException.MISSING_RESULT, "list_security_user_grant failed: unknown result"); + } + + public List list_security_db_grant(String principal_name, boolean is_group, boolean is_role, String db_name) throws MetaException, TException + { + send_list_security_db_grant(principal_name, is_group, is_role, db_name); + return recv_list_security_db_grant(); + } + + public void send_list_security_db_grant(String principal_name, boolean is_group, boolean is_role, String db_name) throws TException + { + oprot_.writeMessageBegin(new TMessage("list_security_db_grant", TMessageType.CALL, seqid_)); + list_security_db_grant_args args = new list_security_db_grant_args(); + args.principal_name = principal_name; + args.is_group = is_group; + args.is_role = is_role; + args.db_name = db_name; + args.write(oprot_); + oprot_.writeMessageEnd(); + oprot_.getTransport().flush(); + } + + public List recv_list_security_db_grant() throws MetaException, TException + { + TMessage msg = iprot_.readMessageBegin(); + if (msg.type == TMessageType.EXCEPTION) { + TApplicationException x = TApplicationException.read(iprot_); + iprot_.readMessageEnd(); + throw x; + } + list_security_db_grant_result result = new list_security_db_grant_result(); + result.read(iprot_); + iprot_.readMessageEnd(); + if (result.isSetSuccess()) { + return result.success; + } + if (result.o1 != null) { + throw result.o1; + } + throw new TApplicationException(TApplicationException.MISSING_RESULT, "list_security_db_grant failed: unknown result"); + } + + public List list_security_table_grant(String principal_name, boolean is_group, boolean is_role, String db_name, String table_name) throws MetaException, TException + { + send_list_security_table_grant(principal_name, is_group, is_role, db_name, table_name); + return recv_list_security_table_grant(); + } + + public void send_list_security_table_grant(String principal_name, boolean is_group, boolean is_role, String db_name, String table_name) throws TException + { + oprot_.writeMessageBegin(new TMessage("list_security_table_grant", TMessageType.CALL, seqid_)); + list_security_table_grant_args args = new list_security_table_grant_args(); + args.principal_name = principal_name; + args.is_group = is_group; + args.is_role = is_role; + args.db_name = db_name; + args.table_name = table_name; + args.write(oprot_); + oprot_.writeMessageEnd(); + oprot_.getTransport().flush(); + } + + public List recv_list_security_table_grant() throws MetaException, TException + { + TMessage msg = iprot_.readMessageBegin(); + if (msg.type == TMessageType.EXCEPTION) { + TApplicationException x = TApplicationException.read(iprot_); + iprot_.readMessageEnd(); + throw x; + } + list_security_table_grant_result result = new list_security_table_grant_result(); + result.read(iprot_); + iprot_.readMessageEnd(); + if (result.isSetSuccess()) { + return result.success; + } + if (result.o1 != null) { + throw result.o1; + } + throw new TApplicationException(TApplicationException.MISSING_RESULT, "list_security_table_grant failed: unknown result"); + } + + public List list_security_partition_grant(String principal_name, boolean is_group, boolean is_role, String db_name, String table_name, String part_name) throws MetaException, TException + { + send_list_security_partition_grant(principal_name, is_group, is_role, db_name, table_name, part_name); + return recv_list_security_partition_grant(); + } + + public void send_list_security_partition_grant(String principal_name, boolean is_group, boolean is_role, String db_name, String table_name, String part_name) throws TException + { + oprot_.writeMessageBegin(new TMessage("list_security_partition_grant", TMessageType.CALL, seqid_)); + list_security_partition_grant_args args = new list_security_partition_grant_args(); + args.principal_name = principal_name; + args.is_group = is_group; + args.is_role = is_role; + args.db_name = db_name; + args.table_name = table_name; + args.part_name = part_name; + args.write(oprot_); + oprot_.writeMessageEnd(); + oprot_.getTransport().flush(); + } + + public List recv_list_security_partition_grant() throws MetaException, TException + { + TMessage msg = iprot_.readMessageBegin(); + if (msg.type == TMessageType.EXCEPTION) { + TApplicationException x = TApplicationException.read(iprot_); + iprot_.readMessageEnd(); + throw x; + } + list_security_partition_grant_result result = new list_security_partition_grant_result(); + result.read(iprot_); + iprot_.readMessageEnd(); + if (result.isSetSuccess()) { + return result.success; + } + if (result.o1 != null) { + throw result.o1; + } + throw new TApplicationException(TApplicationException.MISSING_RESULT, "list_security_partition_grant failed: unknown result"); + } + + public List list_security_column_grant(String principal_name, boolean is_group, boolean is_role, String db_name, String table_name, String column_name) throws MetaException, TException + { + send_list_security_column_grant(principal_name, is_group, is_role, db_name, table_name, column_name); + return recv_list_security_column_grant(); + } + + public void send_list_security_column_grant(String principal_name, boolean is_group, boolean is_role, String db_name, String table_name, String column_name) throws TException + { + oprot_.writeMessageBegin(new TMessage("list_security_column_grant", TMessageType.CALL, seqid_)); + list_security_column_grant_args args = new list_security_column_grant_args(); + args.principal_name = principal_name; + args.is_group = is_group; + args.is_role = is_role; + args.db_name = db_name; + args.table_name = table_name; + args.column_name = column_name; + args.write(oprot_); + oprot_.writeMessageEnd(); + oprot_.getTransport().flush(); + } + + public List recv_list_security_column_grant() throws MetaException, TException + { + TMessage msg = iprot_.readMessageBegin(); + if (msg.type == TMessageType.EXCEPTION) { + TApplicationException x = TApplicationException.read(iprot_); + iprot_.readMessageEnd(); + throw x; + } + list_security_column_grant_result result = new list_security_column_grant_result(); + result.read(iprot_); + iprot_.readMessageEnd(); + if (result.isSetSuccess()) { + return result.success; + } + if (result.o1 != null) { + throw result.o1; + } + throw new TApplicationException(TApplicationException.MISSING_RESULT, "list_security_column_grant failed: unknown result"); + } + + public boolean grant_privileges(String user_name, boolean is_role, boolean is_group, PrivilegeBag privileges, String grantor) throws MetaException, TException + { + send_grant_privileges(user_name, is_role, is_group, privileges, grantor); + return recv_grant_privileges(); + } + + public void send_grant_privileges(String user_name, boolean is_role, boolean is_group, PrivilegeBag privileges, String grantor) throws TException + { + oprot_.writeMessageBegin(new TMessage("grant_privileges", TMessageType.CALL, seqid_)); + grant_privileges_args args = new grant_privileges_args(); + args.user_name = user_name; + args.is_role = is_role; + args.is_group = is_group; + args.privileges = privileges; + args.grantor = grantor; + args.write(oprot_); + oprot_.writeMessageEnd(); + oprot_.getTransport().flush(); + } + + public boolean recv_grant_privileges() throws MetaException, TException + { + TMessage msg = iprot_.readMessageBegin(); + if (msg.type == TMessageType.EXCEPTION) { + TApplicationException x = TApplicationException.read(iprot_); + iprot_.readMessageEnd(); + throw x; + } + grant_privileges_result result = new grant_privileges_result(); + result.read(iprot_); + iprot_.readMessageEnd(); + if (result.isSetSuccess()) { + return result.success; + } + if (result.o1 != null) { + throw result.o1; + } + throw new TApplicationException(TApplicationException.MISSING_RESULT, "grant_privileges failed: unknown result"); + } + + public boolean revoke_privileges(String user_name, boolean is_role, boolean is_group, PrivilegeBag privileges) throws MetaException, TException + { + send_revoke_privileges(user_name, is_role, is_group, privileges); + return recv_revoke_privileges(); + } + + public void send_revoke_privileges(String user_name, boolean is_role, boolean is_group, PrivilegeBag privileges) throws TException + { + oprot_.writeMessageBegin(new TMessage("revoke_privileges", TMessageType.CALL, seqid_)); + revoke_privileges_args args = new revoke_privileges_args(); + args.user_name = user_name; + args.is_role = is_role; + args.is_group = is_group; + args.privileges = privileges; + args.write(oprot_); + oprot_.writeMessageEnd(); + oprot_.getTransport().flush(); + } + + public boolean recv_revoke_privileges() throws MetaException, TException + { + TMessage msg = iprot_.readMessageBegin(); + if (msg.type == TMessageType.EXCEPTION) { + TApplicationException x = TApplicationException.read(iprot_); + iprot_.readMessageEnd(); + throw x; + } + revoke_privileges_result result = new revoke_privileges_result(); + result.read(iprot_); + iprot_.readMessageEnd(); + if (result.isSetSuccess()) { + return result.success; + } + if (result.o1 != null) { + throw result.o1; + } + throw new TApplicationException(TApplicationException.MISSING_RESULT, "revoke_privileges failed: unknown result"); + } + + public boolean revoke_all_privileges(String user_name, boolean is_role, boolean is_group, boolean remove_user_priv, List dbs, List
tables, List parts, Map> columns) throws MetaException, TException + { + send_revoke_all_privileges(user_name, is_role, is_group, remove_user_priv, dbs, tables, parts, columns); + return recv_revoke_all_privileges(); + } + + public void send_revoke_all_privileges(String user_name, boolean is_role, boolean is_group, boolean remove_user_priv, List dbs, List
tables, List parts, Map> columns) throws TException + { + oprot_.writeMessageBegin(new TMessage("revoke_all_privileges", TMessageType.CALL, seqid_)); + revoke_all_privileges_args args = new revoke_all_privileges_args(); + args.user_name = user_name; + args.is_role = is_role; + args.is_group = is_group; + args.remove_user_priv = remove_user_priv; + args.dbs = dbs; + args.tables = tables; + args.parts = parts; + args.columns = columns; + args.write(oprot_); + oprot_.writeMessageEnd(); + oprot_.getTransport().flush(); + } + + public boolean recv_revoke_all_privileges() throws MetaException, TException + { + TMessage msg = iprot_.readMessageBegin(); + if (msg.type == TMessageType.EXCEPTION) { + TApplicationException x = TApplicationException.read(iprot_); + iprot_.readMessageEnd(); + throw x; + } + revoke_all_privileges_result result = new revoke_all_privileges_result(); + result.read(iprot_); + iprot_.readMessageEnd(); + if (result.isSetSuccess()) { + return result.success; + } + if (result.o1 != null) { + throw result.o1; + } + throw new TApplicationException(TApplicationException.MISSING_RESULT, "revoke_all_privileges failed: unknown result"); + } + + } + public static class Processor extends com.facebook.fb303.FacebookService.Processor implements TProcessor { + private static final Logger LOGGER = Logger.getLogger(Processor.class.getName()); + public Processor(Iface iface) + { + super(iface); + iface_ = iface; + processMap_.put("create_database", new create_database()); + processMap_.put("get_database", new get_database()); + processMap_.put("drop_database", new drop_database()); + processMap_.put("get_databases", new get_databases()); + processMap_.put("get_all_databases", new get_all_databases()); + processMap_.put("get_type", new get_type()); + processMap_.put("create_type", new create_type()); + processMap_.put("drop_type", new drop_type()); + processMap_.put("get_type_all", new get_type_all()); + processMap_.put("get_fields", new get_fields()); + processMap_.put("get_schema", new get_schema()); + processMap_.put("create_table", new create_table()); + processMap_.put("drop_table", new drop_table()); + processMap_.put("get_tables", new get_tables()); + processMap_.put("get_all_tables", new get_all_tables()); + processMap_.put("get_table", new get_table()); + processMap_.put("alter_table", new alter_table()); + processMap_.put("add_partition", new add_partition()); + processMap_.put("append_partition", new append_partition()); + processMap_.put("append_partition_by_name", new append_partition_by_name()); + processMap_.put("drop_partition", new drop_partition()); + processMap_.put("drop_partition_by_name", new drop_partition_by_name()); + processMap_.put("get_partition", new get_partition()); + processMap_.put("get_partition_by_name", new get_partition_by_name()); + processMap_.put("get_partitions", new get_partitions()); + processMap_.put("get_partition_names", new get_partition_names()); + processMap_.put("get_partitions_ps", new get_partitions_ps()); + processMap_.put("get_partition_names_ps", new get_partition_names_ps()); + processMap_.put("get_partitions_by_filter", new get_partitions_by_filter()); + processMap_.put("alter_partition", new alter_partition()); + processMap_.put("get_config_value", new get_config_value()); + processMap_.put("partition_name_to_vals", new partition_name_to_vals()); + processMap_.put("partition_name_to_spec", new partition_name_to_spec()); + processMap_.put("add_index", new add_index()); + processMap_.put("drop_index_by_name", new drop_index_by_name()); + processMap_.put("get_index_by_name", new get_index_by_name()); + processMap_.put("get_indexes", new get_indexes()); + processMap_.put("get_index_names", new get_index_names()); + processMap_.put("get_user_privilege_set", new get_user_privilege_set()); + processMap_.put("get_db_privilege_set", new get_db_privilege_set()); + processMap_.put("get_table_privilege_set", new get_table_privilege_set()); + processMap_.put("get_partition_privilege_set", new get_partition_privilege_set()); + processMap_.put("get_column_privilege_set", new get_column_privilege_set()); + processMap_.put("create_role", new create_role()); + processMap_.put("drop_role", new drop_role()); + processMap_.put("add_role_member", new add_role_member()); + processMap_.put("remove_role_member", new remove_role_member()); + processMap_.put("list_security_user_grant", new list_security_user_grant()); + processMap_.put("list_security_db_grant", new list_security_db_grant()); + processMap_.put("list_security_table_grant", new list_security_table_grant()); + processMap_.put("list_security_partition_grant", new list_security_partition_grant()); + processMap_.put("list_security_column_grant", new list_security_column_grant()); + processMap_.put("grant_privileges", new grant_privileges()); + processMap_.put("revoke_privileges", new revoke_privileges()); + processMap_.put("revoke_all_privileges", new revoke_all_privileges()); + } + + private Iface iface_; + + public boolean process(TProtocol iprot, TProtocol oprot) throws TException + { + TMessage msg = iprot.readMessageBegin(); + ProcessFunction fn = processMap_.get(msg.name); + if (fn == null) { + TProtocolUtil.skip(iprot, TType.STRUCT); + iprot.readMessageEnd(); + TApplicationException x = new TApplicationException(TApplicationException.UNKNOWN_METHOD, "Invalid method name: '"+msg.name+"'"); + oprot.writeMessageBegin(new TMessage(msg.name, TMessageType.EXCEPTION, msg.seqid)); + x.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + return true; + } + fn.process(msg.seqid, iprot, oprot); + return true; + } + + private class create_database implements ProcessFunction { + public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException + { + create_database_args args = new create_database_args(); + args.read(iprot); + iprot.readMessageEnd(); + create_database_result result = new create_database_result(); + try { + iface_.create_database(args.database); + } catch (AlreadyExistsException o1) { + result.o1 = o1; + } catch (InvalidObjectException o2) { + result.o2 = o2; + } catch (MetaException o3) { + result.o3 = o3; + } catch (Throwable th) { + LOGGER.error("Internal error processing create_database", th); + TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing create_database"); + oprot.writeMessageBegin(new TMessage("create_database", TMessageType.EXCEPTION, seqid)); + x.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + return; + } + oprot.writeMessageBegin(new TMessage("create_database", TMessageType.REPLY, seqid)); + result.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + } + + } + + private class get_database implements ProcessFunction { + public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException + { + get_database_args args = new get_database_args(); + args.read(iprot); + iprot.readMessageEnd(); + get_database_result result = new get_database_result(); + try { + result.success = iface_.get_database(args.name); + } catch (NoSuchObjectException o1) { + result.o1 = o1; + } catch (MetaException o2) { + result.o2 = o2; + } catch (Throwable th) { + LOGGER.error("Internal error processing get_database", th); + TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing get_database"); + oprot.writeMessageBegin(new TMessage("get_database", TMessageType.EXCEPTION, seqid)); + x.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + return; + } + oprot.writeMessageBegin(new TMessage("get_database", TMessageType.REPLY, seqid)); + result.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + } + + } + + private class drop_database implements ProcessFunction { + public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException + { + drop_database_args args = new drop_database_args(); + args.read(iprot); + iprot.readMessageEnd(); + drop_database_result result = new drop_database_result(); + try { + iface_.drop_database(args.name, args.deleteData); + } catch (NoSuchObjectException o1) { + result.o1 = o1; + } catch (InvalidOperationException o2) { + result.o2 = o2; + } catch (MetaException o3) { + result.o3 = o3; + } catch (Throwable th) { + LOGGER.error("Internal error processing drop_database", th); + TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing drop_database"); + oprot.writeMessageBegin(new TMessage("drop_database", TMessageType.EXCEPTION, seqid)); + x.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + return; + } + oprot.writeMessageBegin(new TMessage("drop_database", TMessageType.REPLY, seqid)); + result.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + } + } private class get_databases implements ProcessFunction { public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException { - get_databases_args args = new get_databases_args(); - args.read(iprot); - iprot.readMessageEnd(); - get_databases_result result = new get_databases_result(); - try { - result.success = iface_.get_databases(args.pattern); - } catch (MetaException o1) { - result.o1 = o1; - } catch (Throwable th) { - LOGGER.error("Internal error processing get_databases", th); - TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing get_databases"); - oprot.writeMessageBegin(new TMessage("get_databases", TMessageType.EXCEPTION, seqid)); - x.write(oprot); - oprot.writeMessageEnd(); - oprot.getTransport().flush(); - return; + get_databases_args args = new get_databases_args(); + args.read(iprot); + iprot.readMessageEnd(); + get_databases_result result = new get_databases_result(); + try { + result.success = iface_.get_databases(args.pattern); + } catch (MetaException o1) { + result.o1 = o1; + } catch (Throwable th) { + LOGGER.error("Internal error processing get_databases", th); + TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing get_databases"); + oprot.writeMessageBegin(new TMessage("get_databases", TMessageType.EXCEPTION, seqid)); + x.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + return; + } + oprot.writeMessageBegin(new TMessage("get_databases", TMessageType.REPLY, seqid)); + result.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + } + + } + + private class get_all_databases implements ProcessFunction { + public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException + { + get_all_databases_args args = new get_all_databases_args(); + args.read(iprot); + iprot.readMessageEnd(); + get_all_databases_result result = new get_all_databases_result(); + try { + result.success = iface_.get_all_databases(); + } catch (MetaException o1) { + result.o1 = o1; + } catch (Throwable th) { + LOGGER.error("Internal error processing get_all_databases", th); + TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing get_all_databases"); + oprot.writeMessageBegin(new TMessage("get_all_databases", TMessageType.EXCEPTION, seqid)); + x.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + return; + } + oprot.writeMessageBegin(new TMessage("get_all_databases", TMessageType.REPLY, seqid)); + result.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + } + + } + + private class get_type implements ProcessFunction { + public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException + { + get_type_args args = new get_type_args(); + args.read(iprot); + iprot.readMessageEnd(); + get_type_result result = new get_type_result(); + try { + result.success = iface_.get_type(args.name); + } catch (MetaException o1) { + result.o1 = o1; + } catch (NoSuchObjectException o2) { + result.o2 = o2; + } catch (Throwable th) { + LOGGER.error("Internal error processing get_type", th); + TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing get_type"); + oprot.writeMessageBegin(new TMessage("get_type", TMessageType.EXCEPTION, seqid)); + x.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + return; + } + oprot.writeMessageBegin(new TMessage("get_type", TMessageType.REPLY, seqid)); + result.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + } + + } + + private class create_type implements ProcessFunction { + public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException + { + create_type_args args = new create_type_args(); + args.read(iprot); + iprot.readMessageEnd(); + create_type_result result = new create_type_result(); + try { + result.success = iface_.create_type(args.type); + result.__isset.success = true; + } catch (AlreadyExistsException o1) { + result.o1 = o1; + } catch (InvalidObjectException o2) { + result.o2 = o2; + } catch (MetaException o3) { + result.o3 = o3; + } catch (Throwable th) { + LOGGER.error("Internal error processing create_type", th); + TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing create_type"); + oprot.writeMessageBegin(new TMessage("create_type", TMessageType.EXCEPTION, seqid)); + x.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + return; + } + oprot.writeMessageBegin(new TMessage("create_type", TMessageType.REPLY, seqid)); + result.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + } + + } + + private class drop_type implements ProcessFunction { + public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException + { + drop_type_args args = new drop_type_args(); + args.read(iprot); + iprot.readMessageEnd(); + drop_type_result result = new drop_type_result(); + try { + result.success = iface_.drop_type(args.type); + result.__isset.success = true; + } catch (MetaException o1) { + result.o1 = o1; + } catch (NoSuchObjectException o2) { + result.o2 = o2; + } catch (Throwable th) { + LOGGER.error("Internal error processing drop_type", th); + TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing drop_type"); + oprot.writeMessageBegin(new TMessage("drop_type", TMessageType.EXCEPTION, seqid)); + x.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + return; + } + oprot.writeMessageBegin(new TMessage("drop_type", TMessageType.REPLY, seqid)); + result.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + } + + } + + private class get_type_all implements ProcessFunction { + public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException + { + get_type_all_args args = new get_type_all_args(); + args.read(iprot); + iprot.readMessageEnd(); + get_type_all_result result = new get_type_all_result(); + try { + result.success = iface_.get_type_all(args.name); + } catch (MetaException o2) { + result.o2 = o2; + } catch (Throwable th) { + LOGGER.error("Internal error processing get_type_all", th); + TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing get_type_all"); + oprot.writeMessageBegin(new TMessage("get_type_all", TMessageType.EXCEPTION, seqid)); + x.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + return; + } + oprot.writeMessageBegin(new TMessage("get_type_all", TMessageType.REPLY, seqid)); + result.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + } + + } + + private class get_fields implements ProcessFunction { + public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException + { + get_fields_args args = new get_fields_args(); + args.read(iprot); + iprot.readMessageEnd(); + get_fields_result result = new get_fields_result(); + try { + result.success = iface_.get_fields(args.db_name, args.table_name); + } catch (MetaException o1) { + result.o1 = o1; + } catch (UnknownTableException o2) { + result.o2 = o2; + } catch (UnknownDBException o3) { + result.o3 = o3; + } catch (Throwable th) { + LOGGER.error("Internal error processing get_fields", th); + TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing get_fields"); + oprot.writeMessageBegin(new TMessage("get_fields", TMessageType.EXCEPTION, seqid)); + x.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + return; + } + oprot.writeMessageBegin(new TMessage("get_fields", TMessageType.REPLY, seqid)); + result.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + } + + } + + private class get_schema implements ProcessFunction { + public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException + { + get_schema_args args = new get_schema_args(); + args.read(iprot); + iprot.readMessageEnd(); + get_schema_result result = new get_schema_result(); + try { + result.success = iface_.get_schema(args.db_name, args.table_name); + } catch (MetaException o1) { + result.o1 = o1; + } catch (UnknownTableException o2) { + result.o2 = o2; + } catch (UnknownDBException o3) { + result.o3 = o3; + } catch (Throwable th) { + LOGGER.error("Internal error processing get_schema", th); + TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing get_schema"); + oprot.writeMessageBegin(new TMessage("get_schema", TMessageType.EXCEPTION, seqid)); + x.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + return; + } + oprot.writeMessageBegin(new TMessage("get_schema", TMessageType.REPLY, seqid)); + result.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + } + + } + + private class create_table implements ProcessFunction { + public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException + { + create_table_args args = new create_table_args(); + args.read(iprot); + iprot.readMessageEnd(); + create_table_result result = new create_table_result(); + try { + iface_.create_table(args.tbl); + } catch (AlreadyExistsException o1) { + result.o1 = o1; + } catch (InvalidObjectException o2) { + result.o2 = o2; + } catch (MetaException o3) { + result.o3 = o3; + } catch (NoSuchObjectException o4) { + result.o4 = o4; + } catch (Throwable th) { + LOGGER.error("Internal error processing create_table", th); + TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing create_table"); + oprot.writeMessageBegin(new TMessage("create_table", TMessageType.EXCEPTION, seqid)); + x.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + return; + } + oprot.writeMessageBegin(new TMessage("create_table", TMessageType.REPLY, seqid)); + result.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + } + + } + + private class drop_table implements ProcessFunction { + public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException + { + drop_table_args args = new drop_table_args(); + args.read(iprot); + iprot.readMessageEnd(); + drop_table_result result = new drop_table_result(); + try { + iface_.drop_table(args.dbname, args.name, args.deleteData); + } catch (NoSuchObjectException o1) { + result.o1 = o1; + } catch (MetaException o3) { + result.o3 = o3; + } catch (Throwable th) { + LOGGER.error("Internal error processing drop_table", th); + TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing drop_table"); + oprot.writeMessageBegin(new TMessage("drop_table", TMessageType.EXCEPTION, seqid)); + x.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + return; + } + oprot.writeMessageBegin(new TMessage("drop_table", TMessageType.REPLY, seqid)); + result.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + } + + } + + private class get_tables implements ProcessFunction { + public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException + { + get_tables_args args = new get_tables_args(); + args.read(iprot); + iprot.readMessageEnd(); + get_tables_result result = new get_tables_result(); + try { + result.success = iface_.get_tables(args.db_name, args.pattern); + } catch (MetaException o1) { + result.o1 = o1; + } catch (Throwable th) { + LOGGER.error("Internal error processing get_tables", th); + TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing get_tables"); + oprot.writeMessageBegin(new TMessage("get_tables", TMessageType.EXCEPTION, seqid)); + x.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + return; + } + oprot.writeMessageBegin(new TMessage("get_tables", TMessageType.REPLY, seqid)); + result.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + } + + } + + private class get_all_tables implements ProcessFunction { + public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException + { + get_all_tables_args args = new get_all_tables_args(); + args.read(iprot); + iprot.readMessageEnd(); + get_all_tables_result result = new get_all_tables_result(); + try { + result.success = iface_.get_all_tables(args.db_name); + } catch (MetaException o1) { + result.o1 = o1; + } catch (Throwable th) { + LOGGER.error("Internal error processing get_all_tables", th); + TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing get_all_tables"); + oprot.writeMessageBegin(new TMessage("get_all_tables", TMessageType.EXCEPTION, seqid)); + x.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + return; + } + oprot.writeMessageBegin(new TMessage("get_all_tables", TMessageType.REPLY, seqid)); + result.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + } + + } + + private class get_table implements ProcessFunction { + public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException + { + get_table_args args = new get_table_args(); + args.read(iprot); + iprot.readMessageEnd(); + get_table_result result = new get_table_result(); + try { + result.success = iface_.get_table(args.dbname, args.tbl_name); + } catch (MetaException o1) { + result.o1 = o1; + } catch (NoSuchObjectException o2) { + result.o2 = o2; + } catch (Throwable th) { + LOGGER.error("Internal error processing get_table", th); + TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing get_table"); + oprot.writeMessageBegin(new TMessage("get_table", TMessageType.EXCEPTION, seqid)); + x.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + return; + } + oprot.writeMessageBegin(new TMessage("get_table", TMessageType.REPLY, seqid)); + result.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + } + + } + + private class alter_table implements ProcessFunction { + public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException + { + alter_table_args args = new alter_table_args(); + args.read(iprot); + iprot.readMessageEnd(); + alter_table_result result = new alter_table_result(); + try { + iface_.alter_table(args.dbname, args.tbl_name, args.new_tbl); + } catch (InvalidOperationException o1) { + result.o1 = o1; + } catch (MetaException o2) { + result.o2 = o2; + } catch (Throwable th) { + LOGGER.error("Internal error processing alter_table", th); + TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing alter_table"); + oprot.writeMessageBegin(new TMessage("alter_table", TMessageType.EXCEPTION, seqid)); + x.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + return; + } + oprot.writeMessageBegin(new TMessage("alter_table", TMessageType.REPLY, seqid)); + result.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + } + + } + + private class add_partition implements ProcessFunction { + public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException + { + add_partition_args args = new add_partition_args(); + args.read(iprot); + iprot.readMessageEnd(); + add_partition_result result = new add_partition_result(); + try { + result.success = iface_.add_partition(args.new_part); + } catch (InvalidObjectException o1) { + result.o1 = o1; + } catch (AlreadyExistsException o2) { + result.o2 = o2; + } catch (MetaException o3) { + result.o3 = o3; + } catch (Throwable th) { + LOGGER.error("Internal error processing add_partition", th); + TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing add_partition"); + oprot.writeMessageBegin(new TMessage("add_partition", TMessageType.EXCEPTION, seqid)); + x.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + return; + } + oprot.writeMessageBegin(new TMessage("add_partition", TMessageType.REPLY, seqid)); + result.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + } + + } + + private class append_partition implements ProcessFunction { + public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException + { + append_partition_args args = new append_partition_args(); + args.read(iprot); + iprot.readMessageEnd(); + append_partition_result result = new append_partition_result(); + try { + result.success = iface_.append_partition(args.db_name, args.tbl_name, args.part_vals); + } catch (InvalidObjectException o1) { + result.o1 = o1; + } catch (AlreadyExistsException o2) { + result.o2 = o2; + } catch (MetaException o3) { + result.o3 = o3; + } catch (Throwable th) { + LOGGER.error("Internal error processing append_partition", th); + TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing append_partition"); + oprot.writeMessageBegin(new TMessage("append_partition", TMessageType.EXCEPTION, seqid)); + x.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + return; + } + oprot.writeMessageBegin(new TMessage("append_partition", TMessageType.REPLY, seqid)); + result.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + } + + } + + private class append_partition_by_name implements ProcessFunction { + public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException + { + append_partition_by_name_args args = new append_partition_by_name_args(); + args.read(iprot); + iprot.readMessageEnd(); + append_partition_by_name_result result = new append_partition_by_name_result(); + try { + result.success = iface_.append_partition_by_name(args.db_name, args.tbl_name, args.part_name); + } catch (InvalidObjectException o1) { + result.o1 = o1; + } catch (AlreadyExistsException o2) { + result.o2 = o2; + } catch (MetaException o3) { + result.o3 = o3; + } catch (Throwable th) { + LOGGER.error("Internal error processing append_partition_by_name", th); + TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing append_partition_by_name"); + oprot.writeMessageBegin(new TMessage("append_partition_by_name", TMessageType.EXCEPTION, seqid)); + x.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + return; + } + oprot.writeMessageBegin(new TMessage("append_partition_by_name", TMessageType.REPLY, seqid)); + result.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + } + + } + + private class drop_partition implements ProcessFunction { + public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException + { + drop_partition_args args = new drop_partition_args(); + args.read(iprot); + iprot.readMessageEnd(); + drop_partition_result result = new drop_partition_result(); + try { + result.success = iface_.drop_partition(args.db_name, args.tbl_name, args.part_vals, args.deleteData); + result.__isset.success = true; + } catch (NoSuchObjectException o1) { + result.o1 = o1; + } catch (MetaException o2) { + result.o2 = o2; + } catch (Throwable th) { + LOGGER.error("Internal error processing drop_partition", th); + TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing drop_partition"); + oprot.writeMessageBegin(new TMessage("drop_partition", TMessageType.EXCEPTION, seqid)); + x.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + return; + } + oprot.writeMessageBegin(new TMessage("drop_partition", TMessageType.REPLY, seqid)); + result.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + } + + } + + private class drop_partition_by_name implements ProcessFunction { + public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException + { + drop_partition_by_name_args args = new drop_partition_by_name_args(); + args.read(iprot); + iprot.readMessageEnd(); + drop_partition_by_name_result result = new drop_partition_by_name_result(); + try { + result.success = iface_.drop_partition_by_name(args.db_name, args.tbl_name, args.part_name, args.deleteData); + result.__isset.success = true; + } catch (NoSuchObjectException o1) { + result.o1 = o1; + } catch (MetaException o2) { + result.o2 = o2; + } catch (Throwable th) { + LOGGER.error("Internal error processing drop_partition_by_name", th); + TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing drop_partition_by_name"); + oprot.writeMessageBegin(new TMessage("drop_partition_by_name", TMessageType.EXCEPTION, seqid)); + x.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + return; + } + oprot.writeMessageBegin(new TMessage("drop_partition_by_name", TMessageType.REPLY, seqid)); + result.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + } + + } + + private class get_partition implements ProcessFunction { + public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException + { + get_partition_args args = new get_partition_args(); + args.read(iprot); + iprot.readMessageEnd(); + get_partition_result result = new get_partition_result(); + try { + result.success = iface_.get_partition(args.db_name, args.tbl_name, args.part_vals); + } catch (MetaException o1) { + result.o1 = o1; + } catch (NoSuchObjectException o2) { + result.o2 = o2; + } catch (Throwable th) { + LOGGER.error("Internal error processing get_partition", th); + TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing get_partition"); + oprot.writeMessageBegin(new TMessage("get_partition", TMessageType.EXCEPTION, seqid)); + x.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + return; + } + oprot.writeMessageBegin(new TMessage("get_partition", TMessageType.REPLY, seqid)); + result.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + } + + } + + private class get_partition_by_name implements ProcessFunction { + public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException + { + get_partition_by_name_args args = new get_partition_by_name_args(); + args.read(iprot); + iprot.readMessageEnd(); + get_partition_by_name_result result = new get_partition_by_name_result(); + try { + result.success = iface_.get_partition_by_name(args.db_name, args.tbl_name, args.part_name); + } catch (MetaException o1) { + result.o1 = o1; + } catch (NoSuchObjectException o2) { + result.o2 = o2; + } catch (Throwable th) { + LOGGER.error("Internal error processing get_partition_by_name", th); + TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing get_partition_by_name"); + oprot.writeMessageBegin(new TMessage("get_partition_by_name", TMessageType.EXCEPTION, seqid)); + x.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + return; + } + oprot.writeMessageBegin(new TMessage("get_partition_by_name", TMessageType.REPLY, seqid)); + result.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + } + + } + + private class get_partitions implements ProcessFunction { + public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException + { + get_partitions_args args = new get_partitions_args(); + args.read(iprot); + iprot.readMessageEnd(); + get_partitions_result result = new get_partitions_result(); + try { + result.success = iface_.get_partitions(args.db_name, args.tbl_name, args.max_parts); + } catch (NoSuchObjectException o1) { + result.o1 = o1; + } catch (MetaException o2) { + result.o2 = o2; + } catch (Throwable th) { + LOGGER.error("Internal error processing get_partitions", th); + TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing get_partitions"); + oprot.writeMessageBegin(new TMessage("get_partitions", TMessageType.EXCEPTION, seqid)); + x.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + return; + } + oprot.writeMessageBegin(new TMessage("get_partitions", TMessageType.REPLY, seqid)); + result.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + } + + } + + private class get_partition_names implements ProcessFunction { + public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException + { + get_partition_names_args args = new get_partition_names_args(); + args.read(iprot); + iprot.readMessageEnd(); + get_partition_names_result result = new get_partition_names_result(); + try { + result.success = iface_.get_partition_names(args.db_name, args.tbl_name, args.max_parts); + } catch (MetaException o2) { + result.o2 = o2; + } catch (Throwable th) { + LOGGER.error("Internal error processing get_partition_names", th); + TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing get_partition_names"); + oprot.writeMessageBegin(new TMessage("get_partition_names", TMessageType.EXCEPTION, seqid)); + x.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + return; + } + oprot.writeMessageBegin(new TMessage("get_partition_names", TMessageType.REPLY, seqid)); + result.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + } + + } + + private class get_partitions_ps implements ProcessFunction { + public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException + { + get_partitions_ps_args args = new get_partitions_ps_args(); + args.read(iprot); + iprot.readMessageEnd(); + get_partitions_ps_result result = new get_partitions_ps_result(); + try { + result.success = iface_.get_partitions_ps(args.db_name, args.tbl_name, args.part_vals, args.max_parts); + } catch (MetaException o1) { + result.o1 = o1; + } catch (Throwable th) { + LOGGER.error("Internal error processing get_partitions_ps", th); + TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing get_partitions_ps"); + oprot.writeMessageBegin(new TMessage("get_partitions_ps", TMessageType.EXCEPTION, seqid)); + x.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + return; + } + oprot.writeMessageBegin(new TMessage("get_partitions_ps", TMessageType.REPLY, seqid)); + result.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + } + + } + + private class get_partition_names_ps implements ProcessFunction { + public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException + { + get_partition_names_ps_args args = new get_partition_names_ps_args(); + args.read(iprot); + iprot.readMessageEnd(); + get_partition_names_ps_result result = new get_partition_names_ps_result(); + try { + result.success = iface_.get_partition_names_ps(args.db_name, args.tbl_name, args.part_vals, args.max_parts); + } catch (MetaException o1) { + result.o1 = o1; + } catch (Throwable th) { + LOGGER.error("Internal error processing get_partition_names_ps", th); + TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing get_partition_names_ps"); + oprot.writeMessageBegin(new TMessage("get_partition_names_ps", TMessageType.EXCEPTION, seqid)); + x.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + return; + } + oprot.writeMessageBegin(new TMessage("get_partition_names_ps", TMessageType.REPLY, seqid)); + result.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + } + + } + + private class get_partitions_by_filter implements ProcessFunction { + public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException + { + get_partitions_by_filter_args args = new get_partitions_by_filter_args(); + args.read(iprot); + iprot.readMessageEnd(); + get_partitions_by_filter_result result = new get_partitions_by_filter_result(); + try { + result.success = iface_.get_partitions_by_filter(args.db_name, args.tbl_name, args.filter, args.max_parts); + } catch (MetaException o1) { + result.o1 = o1; + } catch (NoSuchObjectException o2) { + result.o2 = o2; + } catch (Throwable th) { + LOGGER.error("Internal error processing get_partitions_by_filter", th); + TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing get_partitions_by_filter"); + oprot.writeMessageBegin(new TMessage("get_partitions_by_filter", TMessageType.EXCEPTION, seqid)); + x.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + return; + } + oprot.writeMessageBegin(new TMessage("get_partitions_by_filter", TMessageType.REPLY, seqid)); + result.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + } + + } + + private class alter_partition implements ProcessFunction { + public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException + { + alter_partition_args args = new alter_partition_args(); + args.read(iprot); + iprot.readMessageEnd(); + alter_partition_result result = new alter_partition_result(); + try { + iface_.alter_partition(args.db_name, args.tbl_name, args.new_part); + } catch (InvalidOperationException o1) { + result.o1 = o1; + } catch (MetaException o2) { + result.o2 = o2; + } catch (Throwable th) { + LOGGER.error("Internal error processing alter_partition", th); + TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing alter_partition"); + oprot.writeMessageBegin(new TMessage("alter_partition", TMessageType.EXCEPTION, seqid)); + x.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + return; + } + oprot.writeMessageBegin(new TMessage("alter_partition", TMessageType.REPLY, seqid)); + result.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + } + + } + + private class get_config_value implements ProcessFunction { + public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException + { + get_config_value_args args = new get_config_value_args(); + args.read(iprot); + iprot.readMessageEnd(); + get_config_value_result result = new get_config_value_result(); + try { + result.success = iface_.get_config_value(args.name, args.defaultValue); + } catch (ConfigValSecurityException o1) { + result.o1 = o1; + } catch (Throwable th) { + LOGGER.error("Internal error processing get_config_value", th); + TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing get_config_value"); + oprot.writeMessageBegin(new TMessage("get_config_value", TMessageType.EXCEPTION, seqid)); + x.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + return; + } + oprot.writeMessageBegin(new TMessage("get_config_value", TMessageType.REPLY, seqid)); + result.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + } + + } + + private class partition_name_to_vals implements ProcessFunction { + public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException + { + partition_name_to_vals_args args = new partition_name_to_vals_args(); + args.read(iprot); + iprot.readMessageEnd(); + partition_name_to_vals_result result = new partition_name_to_vals_result(); + try { + result.success = iface_.partition_name_to_vals(args.part_name); + } catch (MetaException o1) { + result.o1 = o1; + } catch (Throwable th) { + LOGGER.error("Internal error processing partition_name_to_vals", th); + TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing partition_name_to_vals"); + oprot.writeMessageBegin(new TMessage("partition_name_to_vals", TMessageType.EXCEPTION, seqid)); + x.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + return; + } + oprot.writeMessageBegin(new TMessage("partition_name_to_vals", TMessageType.REPLY, seqid)); + result.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + } + + } + + private class partition_name_to_spec implements ProcessFunction { + public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException + { + partition_name_to_spec_args args = new partition_name_to_spec_args(); + args.read(iprot); + iprot.readMessageEnd(); + partition_name_to_spec_result result = new partition_name_to_spec_result(); + try { + result.success = iface_.partition_name_to_spec(args.part_name); + } catch (MetaException o1) { + result.o1 = o1; + } catch (Throwable th) { + LOGGER.error("Internal error processing partition_name_to_spec", th); + TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing partition_name_to_spec"); + oprot.writeMessageBegin(new TMessage("partition_name_to_spec", TMessageType.EXCEPTION, seqid)); + x.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + return; + } + oprot.writeMessageBegin(new TMessage("partition_name_to_spec", TMessageType.REPLY, seqid)); + result.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + } + + } + + private class add_index implements ProcessFunction { + public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException + { + add_index_args args = new add_index_args(); + args.read(iprot); + iprot.readMessageEnd(); + add_index_result result = new add_index_result(); + try { + result.success = iface_.add_index(args.new_index, args.index_table); + } catch (InvalidObjectException o1) { + result.o1 = o1; + } catch (AlreadyExistsException o2) { + result.o2 = o2; + } catch (MetaException o3) { + result.o3 = o3; + } catch (Throwable th) { + LOGGER.error("Internal error processing add_index", th); + TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing add_index"); + oprot.writeMessageBegin(new TMessage("add_index", TMessageType.EXCEPTION, seqid)); + x.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + return; + } + oprot.writeMessageBegin(new TMessage("add_index", TMessageType.REPLY, seqid)); + result.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + } + + } + + private class drop_index_by_name implements ProcessFunction { + public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException + { + drop_index_by_name_args args = new drop_index_by_name_args(); + args.read(iprot); + iprot.readMessageEnd(); + drop_index_by_name_result result = new drop_index_by_name_result(); + try { + result.success = iface_.drop_index_by_name(args.db_name, args.tbl_name, args.index_name, args.deleteData); + result.__isset.success = true; + } catch (NoSuchObjectException o1) { + result.o1 = o1; + } catch (MetaException o2) { + result.o2 = o2; + } catch (Throwable th) { + LOGGER.error("Internal error processing drop_index_by_name", th); + TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing drop_index_by_name"); + oprot.writeMessageBegin(new TMessage("drop_index_by_name", TMessageType.EXCEPTION, seqid)); + x.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + return; + } + oprot.writeMessageBegin(new TMessage("drop_index_by_name", TMessageType.REPLY, seqid)); + result.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + } + + } + + private class get_index_by_name implements ProcessFunction { + public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException + { + get_index_by_name_args args = new get_index_by_name_args(); + args.read(iprot); + iprot.readMessageEnd(); + get_index_by_name_result result = new get_index_by_name_result(); + try { + result.success = iface_.get_index_by_name(args.db_name, args.tbl_name, args.index_name); + } catch (MetaException o1) { + result.o1 = o1; + } catch (NoSuchObjectException o2) { + result.o2 = o2; + } catch (Throwable th) { + LOGGER.error("Internal error processing get_index_by_name", th); + TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing get_index_by_name"); + oprot.writeMessageBegin(new TMessage("get_index_by_name", TMessageType.EXCEPTION, seqid)); + x.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + return; + } + oprot.writeMessageBegin(new TMessage("get_index_by_name", TMessageType.REPLY, seqid)); + result.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + } + + } + + private class get_indexes implements ProcessFunction { + public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException + { + get_indexes_args args = new get_indexes_args(); + args.read(iprot); + iprot.readMessageEnd(); + get_indexes_result result = new get_indexes_result(); + try { + result.success = iface_.get_indexes(args.db_name, args.tbl_name, args.max_indexes); + } catch (NoSuchObjectException o1) { + result.o1 = o1; + } catch (MetaException o2) { + result.o2 = o2; + } catch (Throwable th) { + LOGGER.error("Internal error processing get_indexes", th); + TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing get_indexes"); + oprot.writeMessageBegin(new TMessage("get_indexes", TMessageType.EXCEPTION, seqid)); + x.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + return; + } + oprot.writeMessageBegin(new TMessage("get_indexes", TMessageType.REPLY, seqid)); + result.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + } + + } + + private class get_index_names implements ProcessFunction { + public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException + { + get_index_names_args args = new get_index_names_args(); + args.read(iprot); + iprot.readMessageEnd(); + get_index_names_result result = new get_index_names_result(); + try { + result.success = iface_.get_index_names(args.db_name, args.tbl_name, args.max_indexes); + } catch (MetaException o2) { + result.o2 = o2; + } catch (Throwable th) { + LOGGER.error("Internal error processing get_index_names", th); + TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing get_index_names"); + oprot.writeMessageBegin(new TMessage("get_index_names", TMessageType.EXCEPTION, seqid)); + x.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + return; + } + oprot.writeMessageBegin(new TMessage("get_index_names", TMessageType.REPLY, seqid)); + result.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + } + + } + + private class get_user_privilege_set implements ProcessFunction { + public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException + { + get_user_privilege_set_args args = new get_user_privilege_set_args(); + args.read(iprot); + iprot.readMessageEnd(); + get_user_privilege_set_result result = new get_user_privilege_set_result(); + try { + result.success = iface_.get_user_privilege_set(args.user_name, args.group_names); + } catch (MetaException o1) { + result.o1 = o1; + } catch (Throwable th) { + LOGGER.error("Internal error processing get_user_privilege_set", th); + TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing get_user_privilege_set"); + oprot.writeMessageBegin(new TMessage("get_user_privilege_set", TMessageType.EXCEPTION, seqid)); + x.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + return; + } + oprot.writeMessageBegin(new TMessage("get_user_privilege_set", TMessageType.REPLY, seqid)); + result.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + } + + } + + private class get_db_privilege_set implements ProcessFunction { + public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException + { + get_db_privilege_set_args args = new get_db_privilege_set_args(); + args.read(iprot); + iprot.readMessageEnd(); + get_db_privilege_set_result result = new get_db_privilege_set_result(); + try { + result.success = iface_.get_db_privilege_set(args.db_name, args.user_name, args.group_names); + } catch (MetaException o1) { + result.o1 = o1; + } catch (Throwable th) { + LOGGER.error("Internal error processing get_db_privilege_set", th); + TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing get_db_privilege_set"); + oprot.writeMessageBegin(new TMessage("get_db_privilege_set", TMessageType.EXCEPTION, seqid)); + x.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + return; + } + oprot.writeMessageBegin(new TMessage("get_db_privilege_set", TMessageType.REPLY, seqid)); + result.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + } + + } + + private class get_table_privilege_set implements ProcessFunction { + public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException + { + get_table_privilege_set_args args = new get_table_privilege_set_args(); + args.read(iprot); + iprot.readMessageEnd(); + get_table_privilege_set_result result = new get_table_privilege_set_result(); + try { + result.success = iface_.get_table_privilege_set(args.db_name, args.table_name, args.user_name, args.group_names); + } catch (MetaException o1) { + result.o1 = o1; + } catch (Throwable th) { + LOGGER.error("Internal error processing get_table_privilege_set", th); + TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing get_table_privilege_set"); + oprot.writeMessageBegin(new TMessage("get_table_privilege_set", TMessageType.EXCEPTION, seqid)); + x.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + return; + } + oprot.writeMessageBegin(new TMessage("get_table_privilege_set", TMessageType.REPLY, seqid)); + result.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + } + + } + + private class get_partition_privilege_set implements ProcessFunction { + public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException + { + get_partition_privilege_set_args args = new get_partition_privilege_set_args(); + args.read(iprot); + iprot.readMessageEnd(); + get_partition_privilege_set_result result = new get_partition_privilege_set_result(); + try { + result.success = iface_.get_partition_privilege_set(args.db_name, args.table_name, args.part_name, args.user_name, args.group_names); + } catch (MetaException o1) { + result.o1 = o1; + } catch (Throwable th) { + LOGGER.error("Internal error processing get_partition_privilege_set", th); + TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing get_partition_privilege_set"); + oprot.writeMessageBegin(new TMessage("get_partition_privilege_set", TMessageType.EXCEPTION, seqid)); + x.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + return; + } + oprot.writeMessageBegin(new TMessage("get_partition_privilege_set", TMessageType.REPLY, seqid)); + result.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + } + + } + + private class get_column_privilege_set implements ProcessFunction { + public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException + { + get_column_privilege_set_args args = new get_column_privilege_set_args(); + args.read(iprot); + iprot.readMessageEnd(); + get_column_privilege_set_result result = new get_column_privilege_set_result(); + try { + result.success = iface_.get_column_privilege_set(args.db_name, args.table_name, args.part_name, args.column_name, args.user_name, args.group_names); + } catch (MetaException o1) { + result.o1 = o1; + } catch (Throwable th) { + LOGGER.error("Internal error processing get_column_privilege_set", th); + TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing get_column_privilege_set"); + oprot.writeMessageBegin(new TMessage("get_column_privilege_set", TMessageType.EXCEPTION, seqid)); + x.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + return; + } + oprot.writeMessageBegin(new TMessage("get_column_privilege_set", TMessageType.REPLY, seqid)); + result.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + } + + } + + private class create_role implements ProcessFunction { + public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException + { + create_role_args args = new create_role_args(); + args.read(iprot); + iprot.readMessageEnd(); + create_role_result result = new create_role_result(); + try { + result.success = iface_.create_role(args.role_name, args.owner_name); + result.__isset.success = true; + } catch (MetaException o1) { + result.o1 = o1; + } catch (Throwable th) { + LOGGER.error("Internal error processing create_role", th); + TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing create_role"); + oprot.writeMessageBegin(new TMessage("create_role", TMessageType.EXCEPTION, seqid)); + x.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + return; + } + oprot.writeMessageBegin(new TMessage("create_role", TMessageType.REPLY, seqid)); + result.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + } + + } + + private class drop_role implements ProcessFunction { + public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException + { + drop_role_args args = new drop_role_args(); + args.read(iprot); + iprot.readMessageEnd(); + drop_role_result result = new drop_role_result(); + try { + result.success = iface_.drop_role(args.role_name); + result.__isset.success = true; + } catch (MetaException o1) { + result.o1 = o1; + } catch (Throwable th) { + LOGGER.error("Internal error processing drop_role", th); + TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing drop_role"); + oprot.writeMessageBegin(new TMessage("drop_role", TMessageType.EXCEPTION, seqid)); + x.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + return; + } + oprot.writeMessageBegin(new TMessage("drop_role", TMessageType.REPLY, seqid)); + result.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + } + + } + + private class add_role_member implements ProcessFunction { + public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException + { + add_role_member_args args = new add_role_member_args(); + args.read(iprot); + iprot.readMessageEnd(); + add_role_member_result result = new add_role_member_result(); + try { + result.success = iface_.add_role_member(args.role_name, args.user_name, args.is_role, args.is_group); + result.__isset.success = true; + } catch (MetaException o1) { + result.o1 = o1; + } catch (Throwable th) { + LOGGER.error("Internal error processing add_role_member", th); + TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing add_role_member"); + oprot.writeMessageBegin(new TMessage("add_role_member", TMessageType.EXCEPTION, seqid)); + x.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + return; + } + oprot.writeMessageBegin(new TMessage("add_role_member", TMessageType.REPLY, seqid)); + result.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + } + + } + + private class remove_role_member implements ProcessFunction { + public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException + { + remove_role_member_args args = new remove_role_member_args(); + args.read(iprot); + iprot.readMessageEnd(); + remove_role_member_result result = new remove_role_member_result(); + try { + result.success = iface_.remove_role_member(args.role_name, args.user_name, args.is_role, args.is_group); + result.__isset.success = true; + } catch (MetaException o1) { + result.o1 = o1; + } catch (Throwable th) { + LOGGER.error("Internal error processing remove_role_member", th); + TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing remove_role_member"); + oprot.writeMessageBegin(new TMessage("remove_role_member", TMessageType.EXCEPTION, seqid)); + x.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + return; + } + oprot.writeMessageBegin(new TMessage("remove_role_member", TMessageType.REPLY, seqid)); + result.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + } + + } + + private class list_security_user_grant implements ProcessFunction { + public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException + { + list_security_user_grant_args args = new list_security_user_grant_args(); + args.read(iprot); + iprot.readMessageEnd(); + list_security_user_grant_result result = new list_security_user_grant_result(); + try { + result.success = iface_.list_security_user_grant(args.principla_name, args.is_role, args.is_group); + } catch (MetaException o1) { + result.o1 = o1; + } catch (Throwable th) { + LOGGER.error("Internal error processing list_security_user_grant", th); + TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing list_security_user_grant"); + oprot.writeMessageBegin(new TMessage("list_security_user_grant", TMessageType.EXCEPTION, seqid)); + x.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + return; + } + oprot.writeMessageBegin(new TMessage("list_security_user_grant", TMessageType.REPLY, seqid)); + result.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + } + + } + + private class list_security_db_grant implements ProcessFunction { + public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException + { + list_security_db_grant_args args = new list_security_db_grant_args(); + args.read(iprot); + iprot.readMessageEnd(); + list_security_db_grant_result result = new list_security_db_grant_result(); + try { + result.success = iface_.list_security_db_grant(args.principal_name, args.is_group, args.is_role, args.db_name); + } catch (MetaException o1) { + result.o1 = o1; + } catch (Throwable th) { + LOGGER.error("Internal error processing list_security_db_grant", th); + TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing list_security_db_grant"); + oprot.writeMessageBegin(new TMessage("list_security_db_grant", TMessageType.EXCEPTION, seqid)); + x.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + return; + } + oprot.writeMessageBegin(new TMessage("list_security_db_grant", TMessageType.REPLY, seqid)); + result.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + } + + } + + private class list_security_table_grant implements ProcessFunction { + public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException + { + list_security_table_grant_args args = new list_security_table_grant_args(); + args.read(iprot); + iprot.readMessageEnd(); + list_security_table_grant_result result = new list_security_table_grant_result(); + try { + result.success = iface_.list_security_table_grant(args.principal_name, args.is_group, args.is_role, args.db_name, args.table_name); + } catch (MetaException o1) { + result.o1 = o1; + } catch (Throwable th) { + LOGGER.error("Internal error processing list_security_table_grant", th); + TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing list_security_table_grant"); + oprot.writeMessageBegin(new TMessage("list_security_table_grant", TMessageType.EXCEPTION, seqid)); + x.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + return; + } + oprot.writeMessageBegin(new TMessage("list_security_table_grant", TMessageType.REPLY, seqid)); + result.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + } + + } + + private class list_security_partition_grant implements ProcessFunction { + public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException + { + list_security_partition_grant_args args = new list_security_partition_grant_args(); + args.read(iprot); + iprot.readMessageEnd(); + list_security_partition_grant_result result = new list_security_partition_grant_result(); + try { + result.success = iface_.list_security_partition_grant(args.principal_name, args.is_group, args.is_role, args.db_name, args.table_name, args.part_name); + } catch (MetaException o1) { + result.o1 = o1; + } catch (Throwable th) { + LOGGER.error("Internal error processing list_security_partition_grant", th); + TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing list_security_partition_grant"); + oprot.writeMessageBegin(new TMessage("list_security_partition_grant", TMessageType.EXCEPTION, seqid)); + x.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + return; + } + oprot.writeMessageBegin(new TMessage("list_security_partition_grant", TMessageType.REPLY, seqid)); + result.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + } + + } + + private class list_security_column_grant implements ProcessFunction { + public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException + { + list_security_column_grant_args args = new list_security_column_grant_args(); + args.read(iprot); + iprot.readMessageEnd(); + list_security_column_grant_result result = new list_security_column_grant_result(); + try { + result.success = iface_.list_security_column_grant(args.principal_name, args.is_group, args.is_role, args.db_name, args.table_name, args.column_name); + } catch (MetaException o1) { + result.o1 = o1; + } catch (Throwable th) { + LOGGER.error("Internal error processing list_security_column_grant", th); + TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing list_security_column_grant"); + oprot.writeMessageBegin(new TMessage("list_security_column_grant", TMessageType.EXCEPTION, seqid)); + x.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + return; + } + oprot.writeMessageBegin(new TMessage("list_security_column_grant", TMessageType.REPLY, seqid)); + result.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + } + + } + + private class grant_privileges implements ProcessFunction { + public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException + { + grant_privileges_args args = new grant_privileges_args(); + args.read(iprot); + iprot.readMessageEnd(); + grant_privileges_result result = new grant_privileges_result(); + try { + result.success = iface_.grant_privileges(args.user_name, args.is_role, args.is_group, args.privileges, args.grantor); + result.__isset.success = true; + } catch (MetaException o1) { + result.o1 = o1; + } catch (Throwable th) { + LOGGER.error("Internal error processing grant_privileges", th); + TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing grant_privileges"); + oprot.writeMessageBegin(new TMessage("grant_privileges", TMessageType.EXCEPTION, seqid)); + x.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + return; + } + oprot.writeMessageBegin(new TMessage("grant_privileges", TMessageType.REPLY, seqid)); + result.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + } + + } + + private class revoke_privileges implements ProcessFunction { + public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException + { + revoke_privileges_args args = new revoke_privileges_args(); + args.read(iprot); + iprot.readMessageEnd(); + revoke_privileges_result result = new revoke_privileges_result(); + try { + result.success = iface_.revoke_privileges(args.user_name, args.is_role, args.is_group, args.privileges); + result.__isset.success = true; + } catch (MetaException o1) { + result.o1 = o1; + } catch (Throwable th) { + LOGGER.error("Internal error processing revoke_privileges", th); + TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing revoke_privileges"); + oprot.writeMessageBegin(new TMessage("revoke_privileges", TMessageType.EXCEPTION, seqid)); + x.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + return; + } + oprot.writeMessageBegin(new TMessage("revoke_privileges", TMessageType.REPLY, seqid)); + result.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + } + + } + + private class revoke_all_privileges implements ProcessFunction { + public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException + { + revoke_all_privileges_args args = new revoke_all_privileges_args(); + args.read(iprot); + iprot.readMessageEnd(); + revoke_all_privileges_result result = new revoke_all_privileges_result(); + try { + result.success = iface_.revoke_all_privileges(args.user_name, args.is_role, args.is_group, args.remove_user_priv, args.dbs, args.tables, args.parts, args.columns); + result.__isset.success = true; + } catch (MetaException o1) { + result.o1 = o1; + } catch (Throwable th) { + LOGGER.error("Internal error processing revoke_all_privileges", th); + TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing revoke_all_privileges"); + oprot.writeMessageBegin(new TMessage("revoke_all_privileges", TMessageType.EXCEPTION, seqid)); + x.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + return; + } + oprot.writeMessageBegin(new TMessage("revoke_all_privileges", TMessageType.REPLY, seqid)); + result.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + } + + } + + } + + public static class create_database_args implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("create_database_args"); + private static final TField DATABASE_FIELD_DESC = new TField("database", TType.STRUCT, (short)1); + + private Database database; + public static final int DATABASE = 1; + + private final Isset __isset = new Isset(); + private static final class Isset implements java.io.Serializable { + } + + public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ + put(DATABASE, new FieldMetaData("database", TFieldRequirementType.DEFAULT, + new StructMetaData(TType.STRUCT, Database.class))); + }}); + + static { + FieldMetaData.addStructMetaDataMap(create_database_args.class, metaDataMap); + } + + public create_database_args() { + } + + public create_database_args( + Database database) + { + this(); + this.database = database; + } + + /** + * Performs a deep copy on other. + */ + public create_database_args(create_database_args other) { + if (other.isSetDatabase()) { + this.database = new Database(other.database); + } + } + + @Override + public create_database_args clone() { + return new create_database_args(this); + } + + public Database getDatabase() { + return this.database; + } + + public void setDatabase(Database database) { + this.database = database; + } + + public void unsetDatabase() { + this.database = null; + } + + // Returns true if field database is set (has been asigned a value) and false otherwise + public boolean isSetDatabase() { + return this.database != null; + } + + public void setFieldValue(int fieldID, Object value) { + switch (fieldID) { + case DATABASE: + if (value == null) { + unsetDatabase(); + } else { + setDatabase((Database)value); + } + break; + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + public Object getFieldValue(int fieldID) { + switch (fieldID) { + case DATABASE: + return getDatabase(); + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise + public boolean isSet(int fieldID) { + switch (fieldID) { + case DATABASE: + return isSetDatabase(); + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof create_database_args) + return this.equals((create_database_args)that); + return false; + } + + public boolean equals(create_database_args that) { + if (that == null) + return false; + + boolean this_present_database = true && this.isSetDatabase(); + boolean that_present_database = true && that.isSetDatabase(); + if (this_present_database || that_present_database) { + if (!(this_present_database && that_present_database)) + return false; + if (!this.database.equals(that.database)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + public void read(TProtocol iprot) throws TException { + TField field; + iprot.readStructBegin(); + while (true) + { + field = iprot.readFieldBegin(); + if (field.type == TType.STOP) { + break; + } + switch (field.id) + { + case DATABASE: + if (field.type == TType.STRUCT) { + this.database = new Database(); + this.database.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); + break; + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + validate(); + } + + public void write(TProtocol oprot) throws TException { + validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (this.database != null) { + oprot.writeFieldBegin(DATABASE_FIELD_DESC); + this.database.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("create_database_args("); + boolean first = true; + + sb.append("database:"); + if (this.database == null) { + sb.append("null"); + } else { + sb.append(this.database); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws TException { + // check for required fields + // check that fields of type enum have valid values + } + + } + + public static class create_database_result implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("create_database_result"); + private static final TField O1_FIELD_DESC = new TField("o1", TType.STRUCT, (short)1); + private static final TField O2_FIELD_DESC = new TField("o2", TType.STRUCT, (short)2); + private static final TField O3_FIELD_DESC = new TField("o3", TType.STRUCT, (short)3); + + private AlreadyExistsException o1; + public static final int O1 = 1; + private InvalidObjectException o2; + public static final int O2 = 2; + private MetaException o3; + public static final int O3 = 3; + + private final Isset __isset = new Isset(); + private static final class Isset implements java.io.Serializable { + } + + public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ + put(O1, new FieldMetaData("o1", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRUCT))); + put(O2, new FieldMetaData("o2", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRUCT))); + put(O3, new FieldMetaData("o3", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRUCT))); + }}); + + static { + FieldMetaData.addStructMetaDataMap(create_database_result.class, metaDataMap); + } + + public create_database_result() { + } + + public create_database_result( + AlreadyExistsException o1, + InvalidObjectException o2, + MetaException o3) + { + this(); + this.o1 = o1; + this.o2 = o2; + this.o3 = o3; + } + + /** + * Performs a deep copy on other. + */ + public create_database_result(create_database_result other) { + if (other.isSetO1()) { + this.o1 = new AlreadyExistsException(other.o1); + } + if (other.isSetO2()) { + this.o2 = new InvalidObjectException(other.o2); + } + if (other.isSetO3()) { + this.o3 = new MetaException(other.o3); + } + } + + @Override + public create_database_result clone() { + return new create_database_result(this); + } + + public AlreadyExistsException getO1() { + return this.o1; + } + + public void setO1(AlreadyExistsException o1) { + this.o1 = o1; + } + + public void unsetO1() { + this.o1 = null; + } + + // Returns true if field o1 is set (has been asigned a value) and false otherwise + public boolean isSetO1() { + return this.o1 != null; + } + + public InvalidObjectException getO2() { + return this.o2; + } + + public void setO2(InvalidObjectException o2) { + this.o2 = o2; + } + + public void unsetO2() { + this.o2 = null; + } + + // Returns true if field o2 is set (has been asigned a value) and false otherwise + public boolean isSetO2() { + return this.o2 != null; + } + + public MetaException getO3() { + return this.o3; + } + + public void setO3(MetaException o3) { + this.o3 = o3; + } + + public void unsetO3() { + this.o3 = null; + } + + // Returns true if field o3 is set (has been asigned a value) and false otherwise + public boolean isSetO3() { + return this.o3 != null; + } + + public void setFieldValue(int fieldID, Object value) { + switch (fieldID) { + case O1: + if (value == null) { + unsetO1(); + } else { + setO1((AlreadyExistsException)value); + } + break; + + case O2: + if (value == null) { + unsetO2(); + } else { + setO2((InvalidObjectException)value); + } + break; + + case O3: + if (value == null) { + unsetO3(); + } else { + setO3((MetaException)value); + } + break; + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + public Object getFieldValue(int fieldID) { + switch (fieldID) { + case O1: + return getO1(); + + case O2: + return getO2(); + + case O3: + return getO3(); + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise + public boolean isSet(int fieldID) { + switch (fieldID) { + case O1: + return isSetO1(); + case O2: + return isSetO2(); + case O3: + return isSetO3(); + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof create_database_result) + return this.equals((create_database_result)that); + return false; + } + + public boolean equals(create_database_result that) { + if (that == null) + return false; + + boolean this_present_o1 = true && this.isSetO1(); + boolean that_present_o1 = true && that.isSetO1(); + if (this_present_o1 || that_present_o1) { + if (!(this_present_o1 && that_present_o1)) + return false; + if (!this.o1.equals(that.o1)) + return false; + } + + boolean this_present_o2 = true && this.isSetO2(); + boolean that_present_o2 = true && that.isSetO2(); + if (this_present_o2 || that_present_o2) { + if (!(this_present_o2 && that_present_o2)) + return false; + if (!this.o2.equals(that.o2)) + return false; + } + + boolean this_present_o3 = true && this.isSetO3(); + boolean that_present_o3 = true && that.isSetO3(); + if (this_present_o3 || that_present_o3) { + if (!(this_present_o3 && that_present_o3)) + return false; + if (!this.o3.equals(that.o3)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + public void read(TProtocol iprot) throws TException { + TField field; + iprot.readStructBegin(); + while (true) + { + field = iprot.readFieldBegin(); + if (field.type == TType.STOP) { + break; + } + switch (field.id) + { + case O1: + if (field.type == TType.STRUCT) { + this.o1 = new AlreadyExistsException(); + this.o1.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case O2: + if (field.type == TType.STRUCT) { + this.o2 = new InvalidObjectException(); + this.o2.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case O3: + if (field.type == TType.STRUCT) { + this.o3 = new MetaException(); + this.o3.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); + break; + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + validate(); + } + + public void write(TProtocol oprot) throws TException { + oprot.writeStructBegin(STRUCT_DESC); + + if (this.isSetO1()) { + oprot.writeFieldBegin(O1_FIELD_DESC); + this.o1.write(oprot); + oprot.writeFieldEnd(); + } else if (this.isSetO2()) { + oprot.writeFieldBegin(O2_FIELD_DESC); + this.o2.write(oprot); + oprot.writeFieldEnd(); + } else if (this.isSetO3()) { + oprot.writeFieldBegin(O3_FIELD_DESC); + this.o3.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("create_database_result("); + boolean first = true; + + sb.append("o1:"); + if (this.o1 == null) { + sb.append("null"); + } else { + sb.append(this.o1); + } + first = false; + if (!first) sb.append(", "); + sb.append("o2:"); + if (this.o2 == null) { + sb.append("null"); + } else { + sb.append(this.o2); + } + first = false; + if (!first) sb.append(", "); + sb.append("o3:"); + if (this.o3 == null) { + sb.append("null"); + } else { + sb.append(this.o3); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws TException { + // check for required fields + // check that fields of type enum have valid values + } + + } + + public static class get_database_args implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("get_database_args"); + private static final TField NAME_FIELD_DESC = new TField("name", TType.STRING, (short)1); + + private String name; + public static final int NAME = 1; + + private final Isset __isset = new Isset(); + private static final class Isset implements java.io.Serializable { + } + + public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ + put(NAME, new FieldMetaData("name", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + }}); + + static { + FieldMetaData.addStructMetaDataMap(get_database_args.class, metaDataMap); + } + + public get_database_args() { + } + + public get_database_args( + String name) + { + this(); + this.name = name; + } + + /** + * Performs a deep copy on other. + */ + public get_database_args(get_database_args other) { + if (other.isSetName()) { + this.name = other.name; + } + } + + @Override + public get_database_args clone() { + return new get_database_args(this); + } + + 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 asigned a value) and false otherwise + public boolean isSetName() { + return this.name != null; + } + + public void setFieldValue(int fieldID, Object value) { + switch (fieldID) { + case NAME: + if (value == null) { + unsetName(); + } else { + setName((String)value); + } + break; + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + public Object getFieldValue(int fieldID) { + switch (fieldID) { + case NAME: + return getName(); + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise + public boolean isSet(int fieldID) { + switch (fieldID) { + case NAME: + return isSetName(); + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof get_database_args) + return this.equals((get_database_args)that); + return false; + } + + public boolean equals(get_database_args 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() { + return 0; + } + + public void read(TProtocol iprot) throws TException { + TField field; + iprot.readStructBegin(); + while (true) + { + field = iprot.readFieldBegin(); + if (field.type == TType.STOP) { + break; + } + switch (field.id) + { + case NAME: + if (field.type == TType.STRING) { + this.name = iprot.readString(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); + break; + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + validate(); + } + + public void write(TProtocol oprot) throws TException { + validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (this.name != null) { + oprot.writeFieldBegin(NAME_FIELD_DESC); + oprot.writeString(this.name); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("get_database_args("); + 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 TException { + // check for required fields + // check that fields of type enum have valid values + } + + } + + public static class get_database_result implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("get_database_result"); + private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.STRUCT, (short)0); + private static final TField O1_FIELD_DESC = new TField("o1", TType.STRUCT, (short)1); + private static final TField O2_FIELD_DESC = new TField("o2", TType.STRUCT, (short)2); + + private Database success; + public static final int SUCCESS = 0; + private NoSuchObjectException o1; + public static final int O1 = 1; + private MetaException o2; + public static final int O2 = 2; + + private final Isset __isset = new Isset(); + private static final class Isset implements java.io.Serializable { + } + + public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ + put(SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, + new StructMetaData(TType.STRUCT, Database.class))); + put(O1, new FieldMetaData("o1", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRUCT))); + put(O2, new FieldMetaData("o2", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRUCT))); + }}); + + static { + FieldMetaData.addStructMetaDataMap(get_database_result.class, metaDataMap); + } + + public get_database_result() { + } + + public get_database_result( + Database success, + NoSuchObjectException o1, + MetaException o2) + { + this(); + this.success = success; + this.o1 = o1; + this.o2 = o2; + } + + /** + * Performs a deep copy on other. + */ + public get_database_result(get_database_result other) { + if (other.isSetSuccess()) { + this.success = new Database(other.success); + } + if (other.isSetO1()) { + this.o1 = new NoSuchObjectException(other.o1); + } + if (other.isSetO2()) { + this.o2 = new MetaException(other.o2); + } + } + + @Override + public get_database_result clone() { + return new get_database_result(this); + } + + public Database getSuccess() { + return this.success; + } + + public void setSuccess(Database success) { + this.success = success; + } + + public void unsetSuccess() { + this.success = null; + } + + // Returns true if field success is set (has been asigned a value) and false otherwise + public boolean isSetSuccess() { + return this.success != null; + } + + public NoSuchObjectException getO1() { + return this.o1; + } + + public void setO1(NoSuchObjectException o1) { + this.o1 = o1; + } + + public void unsetO1() { + this.o1 = null; + } + + // Returns true if field o1 is set (has been asigned a value) and false otherwise + public boolean isSetO1() { + return this.o1 != null; + } + + public MetaException getO2() { + return this.o2; + } + + public void setO2(MetaException o2) { + this.o2 = o2; + } + + public void unsetO2() { + this.o2 = null; + } + + // Returns true if field o2 is set (has been asigned a value) and false otherwise + public boolean isSetO2() { + return this.o2 != null; + } + + public void setFieldValue(int fieldID, Object value) { + switch (fieldID) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((Database)value); + } + break; + + case O1: + if (value == null) { + unsetO1(); + } else { + setO1((NoSuchObjectException)value); + } + break; + + case O2: + if (value == null) { + unsetO2(); + } else { + setO2((MetaException)value); + } + break; + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + public Object getFieldValue(int fieldID) { + switch (fieldID) { + case SUCCESS: + return getSuccess(); + + case O1: + return getO1(); + + case O2: + return getO2(); + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise + public boolean isSet(int fieldID) { + switch (fieldID) { + case SUCCESS: + return isSetSuccess(); + case O1: + return isSetO1(); + case O2: + return isSetO2(); + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof get_database_result) + return this.equals((get_database_result)that); + return false; + } + + public boolean equals(get_database_result that) { + if (that == null) + return false; + + boolean this_present_success = true && this.isSetSuccess(); + boolean that_present_success = true && that.isSetSuccess(); + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (!this.success.equals(that.success)) + return false; + } + + boolean this_present_o1 = true && this.isSetO1(); + boolean that_present_o1 = true && that.isSetO1(); + if (this_present_o1 || that_present_o1) { + if (!(this_present_o1 && that_present_o1)) + return false; + if (!this.o1.equals(that.o1)) + return false; + } + + boolean this_present_o2 = true && this.isSetO2(); + boolean that_present_o2 = true && that.isSetO2(); + if (this_present_o2 || that_present_o2) { + if (!(this_present_o2 && that_present_o2)) + return false; + if (!this.o2.equals(that.o2)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + public void read(TProtocol iprot) throws TException { + TField field; + iprot.readStructBegin(); + while (true) + { + field = iprot.readFieldBegin(); + if (field.type == TType.STOP) { + break; + } + switch (field.id) + { + case SUCCESS: + if (field.type == TType.STRUCT) { + this.success = new Database(); + this.success.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case O1: + if (field.type == TType.STRUCT) { + this.o1 = new NoSuchObjectException(); + this.o1.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case O2: + if (field.type == TType.STRUCT) { + this.o2 = new MetaException(); + this.o2.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); + break; + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + validate(); + } + + public void write(TProtocol oprot) throws TException { + oprot.writeStructBegin(STRUCT_DESC); + + if (this.isSetSuccess()) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + this.success.write(oprot); + oprot.writeFieldEnd(); + } else if (this.isSetO1()) { + oprot.writeFieldBegin(O1_FIELD_DESC); + this.o1.write(oprot); + oprot.writeFieldEnd(); + } else if (this.isSetO2()) { + oprot.writeFieldBegin(O2_FIELD_DESC); + this.o2.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("get_database_result("); + boolean first = true; + + sb.append("success:"); + if (this.success == null) { + sb.append("null"); + } else { + sb.append(this.success); + } + first = false; + if (!first) sb.append(", "); + sb.append("o1:"); + if (this.o1 == null) { + sb.append("null"); + } else { + sb.append(this.o1); + } + first = false; + if (!first) sb.append(", "); + sb.append("o2:"); + if (this.o2 == null) { + sb.append("null"); + } else { + sb.append(this.o2); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws TException { + // check for required fields + // check that fields of type enum have valid values + } + + } + + public static class drop_database_args implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("drop_database_args"); + private static final TField NAME_FIELD_DESC = new TField("name", TType.STRING, (short)1); + private static final TField DELETE_DATA_FIELD_DESC = new TField("deleteData", TType.BOOL, (short)2); + + private String name; + public static final int NAME = 1; + private boolean deleteData; + public static final int DELETEDATA = 2; + + private final Isset __isset = new Isset(); + private static final class Isset implements java.io.Serializable { + public boolean deleteData = false; + } + + public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ + put(NAME, new FieldMetaData("name", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + put(DELETEDATA, new FieldMetaData("deleteData", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.BOOL))); + }}); + + static { + FieldMetaData.addStructMetaDataMap(drop_database_args.class, metaDataMap); + } + + public drop_database_args() { + } + + public drop_database_args( + String name, + boolean deleteData) + { + this(); + this.name = name; + this.deleteData = deleteData; + this.__isset.deleteData = true; + } + + /** + * Performs a deep copy on other. + */ + public drop_database_args(drop_database_args other) { + if (other.isSetName()) { + this.name = other.name; + } + __isset.deleteData = other.__isset.deleteData; + this.deleteData = other.deleteData; + } + + @Override + public drop_database_args clone() { + return new drop_database_args(this); + } + + 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 asigned a value) and false otherwise + public boolean isSetName() { + return this.name != null; + } + + public boolean isDeleteData() { + return this.deleteData; + } + + public void setDeleteData(boolean deleteData) { + this.deleteData = deleteData; + this.__isset.deleteData = true; + } + + public void unsetDeleteData() { + this.__isset.deleteData = false; + } + + // Returns true if field deleteData is set (has been asigned a value) and false otherwise + public boolean isSetDeleteData() { + return this.__isset.deleteData; + } + + public void setFieldValue(int fieldID, Object value) { + switch (fieldID) { + case NAME: + if (value == null) { + unsetName(); + } else { + setName((String)value); + } + break; + + case DELETEDATA: + if (value == null) { + unsetDeleteData(); + } else { + setDeleteData((Boolean)value); + } + break; + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + public Object getFieldValue(int fieldID) { + switch (fieldID) { + case NAME: + return getName(); + + case DELETEDATA: + return new Boolean(isDeleteData()); + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise + public boolean isSet(int fieldID) { + switch (fieldID) { + case NAME: + return isSetName(); + case DELETEDATA: + return isSetDeleteData(); + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof drop_database_args) + return this.equals((drop_database_args)that); + return false; + } + + public boolean equals(drop_database_args 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; + } + + boolean this_present_deleteData = true; + boolean that_present_deleteData = true; + if (this_present_deleteData || that_present_deleteData) { + if (!(this_present_deleteData && that_present_deleteData)) + return false; + if (this.deleteData != that.deleteData) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + public void read(TProtocol iprot) throws TException { + TField field; + iprot.readStructBegin(); + while (true) + { + field = iprot.readFieldBegin(); + if (field.type == TType.STOP) { + break; + } + switch (field.id) + { + case NAME: + if (field.type == TType.STRING) { + this.name = iprot.readString(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case DELETEDATA: + if (field.type == TType.BOOL) { + this.deleteData = iprot.readBool(); + this.__isset.deleteData = true; + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); + break; + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + validate(); + } + + public void write(TProtocol oprot) throws TException { + validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (this.name != null) { + oprot.writeFieldBegin(NAME_FIELD_DESC); + oprot.writeString(this.name); + oprot.writeFieldEnd(); + } + oprot.writeFieldBegin(DELETE_DATA_FIELD_DESC); + oprot.writeBool(this.deleteData); + oprot.writeFieldEnd(); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("drop_database_args("); + boolean first = true; + + sb.append("name:"); + if (this.name == null) { + sb.append("null"); + } else { + sb.append(this.name); + } + first = false; + if (!first) sb.append(", "); + sb.append("deleteData:"); + sb.append(this.deleteData); + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws TException { + // check for required fields + // check that fields of type enum have valid values + } + + } + + public static class drop_database_result implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("drop_database_result"); + private static final TField O1_FIELD_DESC = new TField("o1", TType.STRUCT, (short)1); + private static final TField O2_FIELD_DESC = new TField("o2", TType.STRUCT, (short)2); + private static final TField O3_FIELD_DESC = new TField("o3", TType.STRUCT, (short)3); + + private NoSuchObjectException o1; + public static final int O1 = 1; + private InvalidOperationException o2; + public static final int O2 = 2; + private MetaException o3; + public static final int O3 = 3; + + private final Isset __isset = new Isset(); + private static final class Isset implements java.io.Serializable { + } + + public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ + put(O1, new FieldMetaData("o1", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRUCT))); + put(O2, new FieldMetaData("o2", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRUCT))); + put(O3, new FieldMetaData("o3", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRUCT))); + }}); + + static { + FieldMetaData.addStructMetaDataMap(drop_database_result.class, metaDataMap); + } + + public drop_database_result() { + } + + public drop_database_result( + NoSuchObjectException o1, + InvalidOperationException o2, + MetaException o3) + { + this(); + this.o1 = o1; + this.o2 = o2; + this.o3 = o3; + } + + /** + * Performs a deep copy on other. + */ + public drop_database_result(drop_database_result other) { + if (other.isSetO1()) { + this.o1 = new NoSuchObjectException(other.o1); + } + if (other.isSetO2()) { + this.o2 = new InvalidOperationException(other.o2); + } + if (other.isSetO3()) { + this.o3 = new MetaException(other.o3); + } + } + + @Override + public drop_database_result clone() { + return new drop_database_result(this); + } + + public NoSuchObjectException getO1() { + return this.o1; + } + + public void setO1(NoSuchObjectException o1) { + this.o1 = o1; + } + + public void unsetO1() { + this.o1 = null; + } + + // Returns true if field o1 is set (has been asigned a value) and false otherwise + public boolean isSetO1() { + return this.o1 != null; + } + + public InvalidOperationException getO2() { + return this.o2; + } + + public void setO2(InvalidOperationException o2) { + this.o2 = o2; + } + + public void unsetO2() { + this.o2 = null; + } + + // Returns true if field o2 is set (has been asigned a value) and false otherwise + public boolean isSetO2() { + return this.o2 != null; + } + + public MetaException getO3() { + return this.o3; + } + + public void setO3(MetaException o3) { + this.o3 = o3; + } + + public void unsetO3() { + this.o3 = null; + } + + // Returns true if field o3 is set (has been asigned a value) and false otherwise + public boolean isSetO3() { + return this.o3 != null; + } + + public void setFieldValue(int fieldID, Object value) { + switch (fieldID) { + case O1: + if (value == null) { + unsetO1(); + } else { + setO1((NoSuchObjectException)value); + } + break; + + case O2: + if (value == null) { + unsetO2(); + } else { + setO2((InvalidOperationException)value); + } + break; + + case O3: + if (value == null) { + unsetO3(); + } else { + setO3((MetaException)value); + } + break; + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + public Object getFieldValue(int fieldID) { + switch (fieldID) { + case O1: + return getO1(); + + case O2: + return getO2(); + + case O3: + return getO3(); + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise + public boolean isSet(int fieldID) { + switch (fieldID) { + case O1: + return isSetO1(); + case O2: + return isSetO2(); + case O3: + return isSetO3(); + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof drop_database_result) + return this.equals((drop_database_result)that); + return false; + } + + public boolean equals(drop_database_result that) { + if (that == null) + return false; + + boolean this_present_o1 = true && this.isSetO1(); + boolean that_present_o1 = true && that.isSetO1(); + if (this_present_o1 || that_present_o1) { + if (!(this_present_o1 && that_present_o1)) + return false; + if (!this.o1.equals(that.o1)) + return false; + } + + boolean this_present_o2 = true && this.isSetO2(); + boolean that_present_o2 = true && that.isSetO2(); + if (this_present_o2 || that_present_o2) { + if (!(this_present_o2 && that_present_o2)) + return false; + if (!this.o2.equals(that.o2)) + return false; + } + + boolean this_present_o3 = true && this.isSetO3(); + boolean that_present_o3 = true && that.isSetO3(); + if (this_present_o3 || that_present_o3) { + if (!(this_present_o3 && that_present_o3)) + return false; + if (!this.o3.equals(that.o3)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + public void read(TProtocol iprot) throws TException { + TField field; + iprot.readStructBegin(); + while (true) + { + field = iprot.readFieldBegin(); + if (field.type == TType.STOP) { + break; + } + switch (field.id) + { + case O1: + if (field.type == TType.STRUCT) { + this.o1 = new NoSuchObjectException(); + this.o1.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case O2: + if (field.type == TType.STRUCT) { + this.o2 = new InvalidOperationException(); + this.o2.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case O3: + if (field.type == TType.STRUCT) { + this.o3 = new MetaException(); + this.o3.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); + break; + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + validate(); + } + + public void write(TProtocol oprot) throws TException { + oprot.writeStructBegin(STRUCT_DESC); + + if (this.isSetO1()) { + oprot.writeFieldBegin(O1_FIELD_DESC); + this.o1.write(oprot); + oprot.writeFieldEnd(); + } else if (this.isSetO2()) { + oprot.writeFieldBegin(O2_FIELD_DESC); + this.o2.write(oprot); + oprot.writeFieldEnd(); + } else if (this.isSetO3()) { + oprot.writeFieldBegin(O3_FIELD_DESC); + this.o3.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("drop_database_result("); + boolean first = true; + + sb.append("o1:"); + if (this.o1 == null) { + sb.append("null"); + } else { + sb.append(this.o1); + } + first = false; + if (!first) sb.append(", "); + sb.append("o2:"); + if (this.o2 == null) { + sb.append("null"); + } else { + sb.append(this.o2); + } + first = false; + if (!first) sb.append(", "); + sb.append("o3:"); + if (this.o3 == null) { + sb.append("null"); + } else { + sb.append(this.o3); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws TException { + // check for required fields + // check that fields of type enum have valid values + } + + } + + public static class get_databases_args implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("get_databases_args"); + private static final TField PATTERN_FIELD_DESC = new TField("pattern", TType.STRING, (short)1); + + private String pattern; + public static final int PATTERN = 1; + + private final Isset __isset = new Isset(); + private static final class Isset implements java.io.Serializable { + } + + public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ + put(PATTERN, new FieldMetaData("pattern", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + }}); + + static { + FieldMetaData.addStructMetaDataMap(get_databases_args.class, metaDataMap); + } + + public get_databases_args() { + } + + public get_databases_args( + String pattern) + { + this(); + this.pattern = pattern; + } + + /** + * Performs a deep copy on other. + */ + public get_databases_args(get_databases_args other) { + if (other.isSetPattern()) { + this.pattern = other.pattern; + } + } + + @Override + public get_databases_args clone() { + return new get_databases_args(this); + } + + public String getPattern() { + return this.pattern; + } + + public void setPattern(String pattern) { + this.pattern = pattern; + } + + public void unsetPattern() { + this.pattern = null; + } + + // Returns true if field pattern is set (has been asigned a value) and false otherwise + public boolean isSetPattern() { + return this.pattern != null; + } + + public void setFieldValue(int fieldID, Object value) { + switch (fieldID) { + case PATTERN: + if (value == null) { + unsetPattern(); + } else { + setPattern((String)value); + } + break; + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + public Object getFieldValue(int fieldID) { + switch (fieldID) { + case PATTERN: + return getPattern(); + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise + public boolean isSet(int fieldID) { + switch (fieldID) { + case PATTERN: + return isSetPattern(); + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof get_databases_args) + return this.equals((get_databases_args)that); + return false; + } + + public boolean equals(get_databases_args that) { + if (that == null) + return false; + + boolean this_present_pattern = true && this.isSetPattern(); + boolean that_present_pattern = true && that.isSetPattern(); + if (this_present_pattern || that_present_pattern) { + if (!(this_present_pattern && that_present_pattern)) + return false; + if (!this.pattern.equals(that.pattern)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + public void read(TProtocol iprot) throws TException { + TField field; + iprot.readStructBegin(); + while (true) + { + field = iprot.readFieldBegin(); + if (field.type == TType.STOP) { + break; + } + switch (field.id) + { + case PATTERN: + if (field.type == TType.STRING) { + this.pattern = iprot.readString(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); + break; + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + validate(); + } + + public void write(TProtocol oprot) throws TException { + validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (this.pattern != null) { + oprot.writeFieldBegin(PATTERN_FIELD_DESC); + oprot.writeString(this.pattern); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("get_databases_args("); + boolean first = true; + + sb.append("pattern:"); + if (this.pattern == null) { + sb.append("null"); + } else { + sb.append(this.pattern); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws TException { + // check for required fields + // check that fields of type enum have valid values + } + + } + + public static class get_databases_result implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("get_databases_result"); + private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.LIST, (short)0); + private static final TField O1_FIELD_DESC = new TField("o1", TType.STRUCT, (short)1); + + private List success; + public static final int SUCCESS = 0; + private MetaException o1; + public static final int O1 = 1; + + private final Isset __isset = new Isset(); + private static final class Isset implements java.io.Serializable { + } + + public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ + put(SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, + new ListMetaData(TType.LIST, + new FieldValueMetaData(TType.STRING)))); + put(O1, new FieldMetaData("o1", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRUCT))); + }}); + + static { + FieldMetaData.addStructMetaDataMap(get_databases_result.class, metaDataMap); + } + + public get_databases_result() { + } + + public get_databases_result( + List success, + MetaException o1) + { + this(); + this.success = success; + this.o1 = o1; + } + + /** + * Performs a deep copy on other. + */ + public get_databases_result(get_databases_result other) { + if (other.isSetSuccess()) { + List __this__success = new ArrayList(); + for (String other_element : other.success) { + __this__success.add(other_element); + } + this.success = __this__success; + } + if (other.isSetO1()) { + this.o1 = new MetaException(other.o1); + } + } + + @Override + public get_databases_result clone() { + return new get_databases_result(this); + } + + public int getSuccessSize() { + return (this.success == null) ? 0 : this.success.size(); + } + + public java.util.Iterator getSuccessIterator() { + return (this.success == null) ? null : this.success.iterator(); + } + + public void addToSuccess(String elem) { + if (this.success == null) { + this.success = new ArrayList(); + } + this.success.add(elem); + } + + public List getSuccess() { + return this.success; + } + + public void setSuccess(List success) { + this.success = success; + } + + public void unsetSuccess() { + this.success = null; + } + + // Returns true if field success is set (has been asigned a value) and false otherwise + public boolean isSetSuccess() { + return this.success != null; + } + + public MetaException getO1() { + return this.o1; + } + + public void setO1(MetaException o1) { + this.o1 = o1; + } + + public void unsetO1() { + this.o1 = null; + } + + // Returns true if field o1 is set (has been asigned a value) and false otherwise + public boolean isSetO1() { + return this.o1 != null; + } + + public void setFieldValue(int fieldID, Object value) { + switch (fieldID) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((List)value); + } + break; + + case O1: + if (value == null) { + unsetO1(); + } else { + setO1((MetaException)value); + } + break; + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + public Object getFieldValue(int fieldID) { + switch (fieldID) { + case SUCCESS: + return getSuccess(); + + case O1: + return getO1(); + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise + public boolean isSet(int fieldID) { + switch (fieldID) { + case SUCCESS: + return isSetSuccess(); + case O1: + return isSetO1(); + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof get_databases_result) + return this.equals((get_databases_result)that); + return false; + } + + public boolean equals(get_databases_result that) { + if (that == null) + return false; + + boolean this_present_success = true && this.isSetSuccess(); + boolean that_present_success = true && that.isSetSuccess(); + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (!this.success.equals(that.success)) + return false; + } + + boolean this_present_o1 = true && this.isSetO1(); + boolean that_present_o1 = true && that.isSetO1(); + if (this_present_o1 || that_present_o1) { + if (!(this_present_o1 && that_present_o1)) + return false; + if (!this.o1.equals(that.o1)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + public void read(TProtocol iprot) throws TException { + TField field; + iprot.readStructBegin(); + while (true) + { + field = iprot.readFieldBegin(); + if (field.type == TType.STOP) { + break; + } + switch (field.id) + { + case SUCCESS: + if (field.type == TType.LIST) { + { + TList _list97 = iprot.readListBegin(); + this.success = new ArrayList(_list97.size); + for (int _i98 = 0; _i98 < _list97.size; ++_i98) + { + String _elem99; + _elem99 = iprot.readString(); + this.success.add(_elem99); + } + iprot.readListEnd(); + } + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case O1: + if (field.type == TType.STRUCT) { + this.o1 = new MetaException(); + this.o1.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); + break; + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + validate(); + } + + public void write(TProtocol oprot) throws TException { + oprot.writeStructBegin(STRUCT_DESC); + + if (this.isSetSuccess()) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + { + oprot.writeListBegin(new TList(TType.STRING, this.success.size())); + for (String _iter100 : this.success) { + oprot.writeString(_iter100); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } else if (this.isSetO1()) { + oprot.writeFieldBegin(O1_FIELD_DESC); + this.o1.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("get_databases_result("); + boolean first = true; + + sb.append("success:"); + if (this.success == null) { + sb.append("null"); + } else { + sb.append(this.success); + } + first = false; + if (!first) sb.append(", "); + sb.append("o1:"); + if (this.o1 == null) { + sb.append("null"); + } else { + sb.append(this.o1); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws TException { + // check for required fields + // check that fields of type enum have valid values + } + + } + + public static class get_all_databases_args implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("get_all_databases_args"); + + public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ + }}); + + static { + FieldMetaData.addStructMetaDataMap(get_all_databases_args.class, metaDataMap); + } + + public get_all_databases_args() { + } + + /** + * Performs a deep copy on other. + */ + public get_all_databases_args(get_all_databases_args other) { + } + + @Override + public get_all_databases_args clone() { + return new get_all_databases_args(this); + } + + public void setFieldValue(int fieldID, Object value) { + switch (fieldID) { + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + public Object getFieldValue(int fieldID) { + switch (fieldID) { + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise + public boolean isSet(int fieldID) { + switch (fieldID) { + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof get_all_databases_args) + return this.equals((get_all_databases_args)that); + return false; + } + + public boolean equals(get_all_databases_args that) { + if (that == null) + return false; + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + public void read(TProtocol iprot) throws TException { + TField field; + iprot.readStructBegin(); + while (true) + { + field = iprot.readFieldBegin(); + if (field.type == TType.STOP) { + break; + } + switch (field.id) + { + default: + TProtocolUtil.skip(iprot, field.type); + break; + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + validate(); + } + + public void write(TProtocol oprot) throws TException { + validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("get_all_databases_args("); + boolean first = true; + + sb.append(")"); + return sb.toString(); + } + + public void validate() throws TException { + // check for required fields + // check that fields of type enum have valid values + } + + } + + public static class get_all_databases_result implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("get_all_databases_result"); + private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.LIST, (short)0); + private static final TField O1_FIELD_DESC = new TField("o1", TType.STRUCT, (short)1); + + private List success; + public static final int SUCCESS = 0; + private MetaException o1; + public static final int O1 = 1; + + private final Isset __isset = new Isset(); + private static final class Isset implements java.io.Serializable { + } + + public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ + put(SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, + new ListMetaData(TType.LIST, + new FieldValueMetaData(TType.STRING)))); + put(O1, new FieldMetaData("o1", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRUCT))); + }}); + + static { + FieldMetaData.addStructMetaDataMap(get_all_databases_result.class, metaDataMap); + } + + public get_all_databases_result() { + } + + public get_all_databases_result( + List success, + MetaException o1) + { + this(); + this.success = success; + this.o1 = o1; + } + + /** + * Performs a deep copy on other. + */ + public get_all_databases_result(get_all_databases_result other) { + if (other.isSetSuccess()) { + List __this__success = new ArrayList(); + for (String other_element : other.success) { + __this__success.add(other_element); + } + this.success = __this__success; + } + if (other.isSetO1()) { + this.o1 = new MetaException(other.o1); + } + } + + @Override + public get_all_databases_result clone() { + return new get_all_databases_result(this); + } + + public int getSuccessSize() { + return (this.success == null) ? 0 : this.success.size(); + } + + public java.util.Iterator getSuccessIterator() { + return (this.success == null) ? null : this.success.iterator(); + } + + public void addToSuccess(String elem) { + if (this.success == null) { + this.success = new ArrayList(); + } + this.success.add(elem); + } + + public List getSuccess() { + return this.success; + } + + public void setSuccess(List success) { + this.success = success; + } + + public void unsetSuccess() { + this.success = null; + } + + // Returns true if field success is set (has been asigned a value) and false otherwise + public boolean isSetSuccess() { + return this.success != null; + } + + public MetaException getO1() { + return this.o1; + } + + public void setO1(MetaException o1) { + this.o1 = o1; + } + + public void unsetO1() { + this.o1 = null; + } + + // Returns true if field o1 is set (has been asigned a value) and false otherwise + public boolean isSetO1() { + return this.o1 != null; + } + + public void setFieldValue(int fieldID, Object value) { + switch (fieldID) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((List)value); + } + break; + + case O1: + if (value == null) { + unsetO1(); + } else { + setO1((MetaException)value); + } + break; + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + public Object getFieldValue(int fieldID) { + switch (fieldID) { + case SUCCESS: + return getSuccess(); + + case O1: + return getO1(); + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise + public boolean isSet(int fieldID) { + switch (fieldID) { + case SUCCESS: + return isSetSuccess(); + case O1: + return isSetO1(); + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof get_all_databases_result) + return this.equals((get_all_databases_result)that); + return false; + } + + public boolean equals(get_all_databases_result that) { + if (that == null) + return false; + + boolean this_present_success = true && this.isSetSuccess(); + boolean that_present_success = true && that.isSetSuccess(); + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (!this.success.equals(that.success)) + return false; + } + + boolean this_present_o1 = true && this.isSetO1(); + boolean that_present_o1 = true && that.isSetO1(); + if (this_present_o1 || that_present_o1) { + if (!(this_present_o1 && that_present_o1)) + return false; + if (!this.o1.equals(that.o1)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + public void read(TProtocol iprot) throws TException { + TField field; + iprot.readStructBegin(); + while (true) + { + field = iprot.readFieldBegin(); + if (field.type == TType.STOP) { + break; + } + switch (field.id) + { + case SUCCESS: + if (field.type == TType.LIST) { + { + TList _list101 = iprot.readListBegin(); + this.success = new ArrayList(_list101.size); + for (int _i102 = 0; _i102 < _list101.size; ++_i102) + { + String _elem103; + _elem103 = iprot.readString(); + this.success.add(_elem103); + } + iprot.readListEnd(); + } + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case O1: + if (field.type == TType.STRUCT) { + this.o1 = new MetaException(); + this.o1.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); + break; + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + validate(); + } + + public void write(TProtocol oprot) throws TException { + oprot.writeStructBegin(STRUCT_DESC); + + if (this.isSetSuccess()) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + { + oprot.writeListBegin(new TList(TType.STRING, this.success.size())); + for (String _iter104 : this.success) { + oprot.writeString(_iter104); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } else if (this.isSetO1()) { + oprot.writeFieldBegin(O1_FIELD_DESC); + this.o1.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("get_all_databases_result("); + boolean first = true; + + sb.append("success:"); + if (this.success == null) { + sb.append("null"); + } else { + sb.append(this.success); + } + first = false; + if (!first) sb.append(", "); + sb.append("o1:"); + if (this.o1 == null) { + sb.append("null"); + } else { + sb.append(this.o1); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws TException { + // check for required fields + // check that fields of type enum have valid values + } + + } + + public static class get_type_args implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("get_type_args"); + private static final TField NAME_FIELD_DESC = new TField("name", TType.STRING, (short)1); + + private String name; + public static final int NAME = 1; + + private final Isset __isset = new Isset(); + private static final class Isset implements java.io.Serializable { + } + + public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ + put(NAME, new FieldMetaData("name", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + }}); + + static { + FieldMetaData.addStructMetaDataMap(get_type_args.class, metaDataMap); + } + + public get_type_args() { + } + + public get_type_args( + String name) + { + this(); + this.name = name; + } + + /** + * Performs a deep copy on other. + */ + public get_type_args(get_type_args other) { + if (other.isSetName()) { + this.name = other.name; + } + } + + @Override + public get_type_args clone() { + return new get_type_args(this); + } + + 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 asigned a value) and false otherwise + public boolean isSetName() { + return this.name != null; + } + + public void setFieldValue(int fieldID, Object value) { + switch (fieldID) { + case NAME: + if (value == null) { + unsetName(); + } else { + setName((String)value); + } + break; + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + public Object getFieldValue(int fieldID) { + switch (fieldID) { + case NAME: + return getName(); + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise + public boolean isSet(int fieldID) { + switch (fieldID) { + case NAME: + return isSetName(); + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof get_type_args) + return this.equals((get_type_args)that); + return false; + } + + public boolean equals(get_type_args 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() { + return 0; + } + + public void read(TProtocol iprot) throws TException { + TField field; + iprot.readStructBegin(); + while (true) + { + field = iprot.readFieldBegin(); + if (field.type == TType.STOP) { + break; + } + switch (field.id) + { + case NAME: + if (field.type == TType.STRING) { + this.name = iprot.readString(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); + break; + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + validate(); + } + + public void write(TProtocol oprot) throws TException { + validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (this.name != null) { + oprot.writeFieldBegin(NAME_FIELD_DESC); + oprot.writeString(this.name); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("get_type_args("); + 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 TException { + // check for required fields + // check that fields of type enum have valid values + } + + } + + public static class get_type_result implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("get_type_result"); + private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.STRUCT, (short)0); + private static final TField O1_FIELD_DESC = new TField("o1", TType.STRUCT, (short)1); + private static final TField O2_FIELD_DESC = new TField("o2", TType.STRUCT, (short)2); + + private Type success; + public static final int SUCCESS = 0; + private MetaException o1; + public static final int O1 = 1; + private NoSuchObjectException o2; + public static final int O2 = 2; + + private final Isset __isset = new Isset(); + private static final class Isset implements java.io.Serializable { + } + + public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ + put(SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, + new StructMetaData(TType.STRUCT, Type.class))); + put(O1, new FieldMetaData("o1", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRUCT))); + put(O2, new FieldMetaData("o2", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRUCT))); + }}); + + static { + FieldMetaData.addStructMetaDataMap(get_type_result.class, metaDataMap); + } + + public get_type_result() { + } + + public get_type_result( + Type success, + MetaException o1, + NoSuchObjectException o2) + { + this(); + this.success = success; + this.o1 = o1; + this.o2 = o2; + } + + /** + * Performs a deep copy on other. + */ + public get_type_result(get_type_result other) { + if (other.isSetSuccess()) { + this.success = new Type(other.success); + } + if (other.isSetO1()) { + this.o1 = new MetaException(other.o1); + } + if (other.isSetO2()) { + this.o2 = new NoSuchObjectException(other.o2); + } + } + + @Override + public get_type_result clone() { + return new get_type_result(this); + } + + public Type getSuccess() { + return this.success; + } + + public void setSuccess(Type success) { + this.success = success; + } + + public void unsetSuccess() { + this.success = null; + } + + // Returns true if field success is set (has been asigned a value) and false otherwise + public boolean isSetSuccess() { + return this.success != null; + } + + public MetaException getO1() { + return this.o1; + } + + public void setO1(MetaException o1) { + this.o1 = o1; + } + + public void unsetO1() { + this.o1 = null; + } + + // Returns true if field o1 is set (has been asigned a value) and false otherwise + public boolean isSetO1() { + return this.o1 != null; + } + + public NoSuchObjectException getO2() { + return this.o2; + } + + public void setO2(NoSuchObjectException o2) { + this.o2 = o2; + } + + public void unsetO2() { + this.o2 = null; + } + + // Returns true if field o2 is set (has been asigned a value) and false otherwise + public boolean isSetO2() { + return this.o2 != null; + } + + public void setFieldValue(int fieldID, Object value) { + switch (fieldID) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((Type)value); + } + break; + + case O1: + if (value == null) { + unsetO1(); + } else { + setO1((MetaException)value); + } + break; + + case O2: + if (value == null) { + unsetO2(); + } else { + setO2((NoSuchObjectException)value); + } + break; + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + public Object getFieldValue(int fieldID) { + switch (fieldID) { + case SUCCESS: + return getSuccess(); + + case O1: + return getO1(); + + case O2: + return getO2(); + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise + public boolean isSet(int fieldID) { + switch (fieldID) { + case SUCCESS: + return isSetSuccess(); + case O1: + return isSetO1(); + case O2: + return isSetO2(); + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof get_type_result) + return this.equals((get_type_result)that); + return false; + } + + public boolean equals(get_type_result that) { + if (that == null) + return false; + + boolean this_present_success = true && this.isSetSuccess(); + boolean that_present_success = true && that.isSetSuccess(); + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (!this.success.equals(that.success)) + return false; + } + + boolean this_present_o1 = true && this.isSetO1(); + boolean that_present_o1 = true && that.isSetO1(); + if (this_present_o1 || that_present_o1) { + if (!(this_present_o1 && that_present_o1)) + return false; + if (!this.o1.equals(that.o1)) + return false; + } + + boolean this_present_o2 = true && this.isSetO2(); + boolean that_present_o2 = true && that.isSetO2(); + if (this_present_o2 || that_present_o2) { + if (!(this_present_o2 && that_present_o2)) + return false; + if (!this.o2.equals(that.o2)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + public void read(TProtocol iprot) throws TException { + TField field; + iprot.readStructBegin(); + while (true) + { + field = iprot.readFieldBegin(); + if (field.type == TType.STOP) { + break; + } + switch (field.id) + { + case SUCCESS: + if (field.type == TType.STRUCT) { + this.success = new Type(); + this.success.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case O1: + if (field.type == TType.STRUCT) { + this.o1 = new MetaException(); + this.o1.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case O2: + if (field.type == TType.STRUCT) { + this.o2 = new NoSuchObjectException(); + this.o2.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); + break; + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + validate(); + } + + public void write(TProtocol oprot) throws TException { + oprot.writeStructBegin(STRUCT_DESC); + + if (this.isSetSuccess()) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + this.success.write(oprot); + oprot.writeFieldEnd(); + } else if (this.isSetO1()) { + oprot.writeFieldBegin(O1_FIELD_DESC); + this.o1.write(oprot); + oprot.writeFieldEnd(); + } else if (this.isSetO2()) { + oprot.writeFieldBegin(O2_FIELD_DESC); + this.o2.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("get_type_result("); + boolean first = true; + + sb.append("success:"); + if (this.success == null) { + sb.append("null"); + } else { + sb.append(this.success); + } + first = false; + if (!first) sb.append(", "); + sb.append("o1:"); + if (this.o1 == null) { + sb.append("null"); + } else { + sb.append(this.o1); + } + first = false; + if (!first) sb.append(", "); + sb.append("o2:"); + if (this.o2 == null) { + sb.append("null"); + } else { + sb.append(this.o2); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws TException { + // check for required fields + // check that fields of type enum have valid values + } + + } + + public static class create_type_args implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("create_type_args"); + private static final TField TYPE_FIELD_DESC = new TField("type", TType.STRUCT, (short)1); + + private Type type; + public static final int TYPE = 1; + + private final Isset __isset = new Isset(); + private static final class Isset implements java.io.Serializable { + } + + public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ + put(TYPE, new FieldMetaData("type", TFieldRequirementType.DEFAULT, + new StructMetaData(TType.STRUCT, Type.class))); + }}); + + static { + FieldMetaData.addStructMetaDataMap(create_type_args.class, metaDataMap); + } + + public create_type_args() { + } + + public create_type_args( + Type type) + { + this(); + this.type = type; + } + + /** + * Performs a deep copy on other. + */ + public create_type_args(create_type_args other) { + if (other.isSetType()) { + this.type = new Type(other.type); + } + } + + @Override + public create_type_args clone() { + return new create_type_args(this); + } + + public Type getType() { + return this.type; + } + + public void setType(Type type) { + this.type = type; + } + + public void unsetType() { + this.type = null; + } + + // Returns true if field type is set (has been asigned a value) and false otherwise + public boolean isSetType() { + return this.type != null; + } + + public void setFieldValue(int fieldID, Object value) { + switch (fieldID) { + case TYPE: + if (value == null) { + unsetType(); + } else { + setType((Type)value); + } + break; + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + public Object getFieldValue(int fieldID) { + switch (fieldID) { + case TYPE: + return getType(); + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise + public boolean isSet(int fieldID) { + switch (fieldID) { + case TYPE: + return isSetType(); + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof create_type_args) + return this.equals((create_type_args)that); + return false; + } + + public boolean equals(create_type_args that) { + if (that == null) + return false; + + boolean this_present_type = true && this.isSetType(); + boolean that_present_type = true && that.isSetType(); + if (this_present_type || that_present_type) { + if (!(this_present_type && that_present_type)) + return false; + if (!this.type.equals(that.type)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + public void read(TProtocol iprot) throws TException { + TField field; + iprot.readStructBegin(); + while (true) + { + field = iprot.readFieldBegin(); + if (field.type == TType.STOP) { + break; + } + switch (field.id) + { + case TYPE: + if (field.type == TType.STRUCT) { + this.type = new Type(); + this.type.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); + break; + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + validate(); + } + + public void write(TProtocol oprot) throws TException { + validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (this.type != null) { + oprot.writeFieldBegin(TYPE_FIELD_DESC); + this.type.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("create_type_args("); + boolean first = true; + + sb.append("type:"); + if (this.type == null) { + sb.append("null"); + } else { + sb.append(this.type); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws TException { + // check for required fields + // check that fields of type enum have valid values + } + + } + + public static class create_type_result implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("create_type_result"); + private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.BOOL, (short)0); + private static final TField O1_FIELD_DESC = new TField("o1", TType.STRUCT, (short)1); + private static final TField O2_FIELD_DESC = new TField("o2", TType.STRUCT, (short)2); + private static final TField O3_FIELD_DESC = new TField("o3", TType.STRUCT, (short)3); + + private boolean success; + public static final int SUCCESS = 0; + private AlreadyExistsException o1; + public static final int O1 = 1; + private InvalidObjectException o2; + public static final int O2 = 2; + private MetaException o3; + public static final int O3 = 3; + + private final Isset __isset = new Isset(); + private static final class Isset implements java.io.Serializable { + public boolean success = false; + } + + public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ + put(SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.BOOL))); + put(O1, new FieldMetaData("o1", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRUCT))); + put(O2, new FieldMetaData("o2", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRUCT))); + put(O3, new FieldMetaData("o3", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRUCT))); + }}); + + static { + FieldMetaData.addStructMetaDataMap(create_type_result.class, metaDataMap); + } + + public create_type_result() { + } + + public create_type_result( + boolean success, + AlreadyExistsException o1, + InvalidObjectException o2, + MetaException o3) + { + this(); + this.success = success; + this.__isset.success = true; + this.o1 = o1; + this.o2 = o2; + this.o3 = o3; + } + + /** + * Performs a deep copy on other. + */ + public create_type_result(create_type_result other) { + __isset.success = other.__isset.success; + this.success = other.success; + if (other.isSetO1()) { + this.o1 = new AlreadyExistsException(other.o1); + } + if (other.isSetO2()) { + this.o2 = new InvalidObjectException(other.o2); + } + if (other.isSetO3()) { + this.o3 = new MetaException(other.o3); + } + } + + @Override + public create_type_result clone() { + return new create_type_result(this); + } + + public boolean isSuccess() { + return this.success; + } + + public void setSuccess(boolean success) { + this.success = success; + this.__isset.success = true; + } + + public void unsetSuccess() { + this.__isset.success = false; + } + + // Returns true if field success is set (has been asigned a value) and false otherwise + public boolean isSetSuccess() { + return this.__isset.success; + } + + public AlreadyExistsException getO1() { + return this.o1; + } + + public void setO1(AlreadyExistsException o1) { + this.o1 = o1; + } + + public void unsetO1() { + this.o1 = null; + } + + // Returns true if field o1 is set (has been asigned a value) and false otherwise + public boolean isSetO1() { + return this.o1 != null; + } + + public InvalidObjectException getO2() { + return this.o2; + } + + public void setO2(InvalidObjectException o2) { + this.o2 = o2; + } + + public void unsetO2() { + this.o2 = null; + } + + // Returns true if field o2 is set (has been asigned a value) and false otherwise + public boolean isSetO2() { + return this.o2 != null; + } + + public MetaException getO3() { + return this.o3; + } + + public void setO3(MetaException o3) { + this.o3 = o3; + } + + public void unsetO3() { + this.o3 = null; + } + + // Returns true if field o3 is set (has been asigned a value) and false otherwise + public boolean isSetO3() { + return this.o3 != null; + } + + public void setFieldValue(int fieldID, Object value) { + switch (fieldID) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((Boolean)value); + } + break; + + case O1: + if (value == null) { + unsetO1(); + } else { + setO1((AlreadyExistsException)value); + } + break; + + case O2: + if (value == null) { + unsetO2(); + } else { + setO2((InvalidObjectException)value); + } + break; + + case O3: + if (value == null) { + unsetO3(); + } else { + setO3((MetaException)value); + } + break; + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + public Object getFieldValue(int fieldID) { + switch (fieldID) { + case SUCCESS: + return new Boolean(isSuccess()); + + case O1: + return getO1(); + + case O2: + return getO2(); + + case O3: + return getO3(); + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise + public boolean isSet(int fieldID) { + switch (fieldID) { + case SUCCESS: + return isSetSuccess(); + case O1: + return isSetO1(); + case O2: + return isSetO2(); + case O3: + return isSetO3(); + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof create_type_result) + return this.equals((create_type_result)that); + return false; + } + + public boolean equals(create_type_result that) { + if (that == null) + return false; + + boolean this_present_success = true; + boolean that_present_success = true; + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (this.success != that.success) + return false; + } + + boolean this_present_o1 = true && this.isSetO1(); + boolean that_present_o1 = true && that.isSetO1(); + if (this_present_o1 || that_present_o1) { + if (!(this_present_o1 && that_present_o1)) + return false; + if (!this.o1.equals(that.o1)) + return false; + } + + boolean this_present_o2 = true && this.isSetO2(); + boolean that_present_o2 = true && that.isSetO2(); + if (this_present_o2 || that_present_o2) { + if (!(this_present_o2 && that_present_o2)) + return false; + if (!this.o2.equals(that.o2)) + return false; + } + + boolean this_present_o3 = true && this.isSetO3(); + boolean that_present_o3 = true && that.isSetO3(); + if (this_present_o3 || that_present_o3) { + if (!(this_present_o3 && that_present_o3)) + return false; + if (!this.o3.equals(that.o3)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + public void read(TProtocol iprot) throws TException { + TField field; + iprot.readStructBegin(); + while (true) + { + field = iprot.readFieldBegin(); + if (field.type == TType.STOP) { + break; + } + switch (field.id) + { + case SUCCESS: + if (field.type == TType.BOOL) { + this.success = iprot.readBool(); + this.__isset.success = true; + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case O1: + if (field.type == TType.STRUCT) { + this.o1 = new AlreadyExistsException(); + this.o1.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case O2: + if (field.type == TType.STRUCT) { + this.o2 = new InvalidObjectException(); + this.o2.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case O3: + if (field.type == TType.STRUCT) { + this.o3 = new MetaException(); + this.o3.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); + break; + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + validate(); + } + + public void write(TProtocol oprot) throws TException { + oprot.writeStructBegin(STRUCT_DESC); + + if (this.isSetSuccess()) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + oprot.writeBool(this.success); + oprot.writeFieldEnd(); + } else if (this.isSetO1()) { + oprot.writeFieldBegin(O1_FIELD_DESC); + this.o1.write(oprot); + oprot.writeFieldEnd(); + } else if (this.isSetO2()) { + oprot.writeFieldBegin(O2_FIELD_DESC); + this.o2.write(oprot); + oprot.writeFieldEnd(); + } else if (this.isSetO3()) { + oprot.writeFieldBegin(O3_FIELD_DESC); + this.o3.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("create_type_result("); + boolean first = true; + + sb.append("success:"); + sb.append(this.success); + first = false; + if (!first) sb.append(", "); + sb.append("o1:"); + if (this.o1 == null) { + sb.append("null"); + } else { + sb.append(this.o1); + } + first = false; + if (!first) sb.append(", "); + sb.append("o2:"); + if (this.o2 == null) { + sb.append("null"); + } else { + sb.append(this.o2); + } + first = false; + if (!first) sb.append(", "); + sb.append("o3:"); + if (this.o3 == null) { + sb.append("null"); + } else { + sb.append(this.o3); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws TException { + // check for required fields + // check that fields of type enum have valid values + } + + } + + public static class drop_type_args implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("drop_type_args"); + private static final TField TYPE_FIELD_DESC = new TField("type", TType.STRING, (short)1); + + private String type; + public static final int TYPE = 1; + + private final Isset __isset = new Isset(); + private static final class Isset implements java.io.Serializable { + } + + public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ + put(TYPE, new FieldMetaData("type", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + }}); + + static { + FieldMetaData.addStructMetaDataMap(drop_type_args.class, metaDataMap); + } + + public drop_type_args() { + } + + public drop_type_args( + String type) + { + this(); + this.type = type; + } + + /** + * Performs a deep copy on other. + */ + public drop_type_args(drop_type_args other) { + if (other.isSetType()) { + this.type = other.type; + } + } + + @Override + public drop_type_args clone() { + return new drop_type_args(this); + } + + public String getType() { + return this.type; + } + + public void setType(String type) { + this.type = type; + } + + public void unsetType() { + this.type = null; + } + + // Returns true if field type is set (has been asigned a value) and false otherwise + public boolean isSetType() { + return this.type != null; + } + + public void setFieldValue(int fieldID, Object value) { + switch (fieldID) { + case TYPE: + if (value == null) { + unsetType(); + } else { + setType((String)value); + } + break; + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + public Object getFieldValue(int fieldID) { + switch (fieldID) { + case TYPE: + return getType(); + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise + public boolean isSet(int fieldID) { + switch (fieldID) { + case TYPE: + return isSetType(); + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof drop_type_args) + return this.equals((drop_type_args)that); + return false; + } + + public boolean equals(drop_type_args that) { + if (that == null) + return false; + + boolean this_present_type = true && this.isSetType(); + boolean that_present_type = true && that.isSetType(); + if (this_present_type || that_present_type) { + if (!(this_present_type && that_present_type)) + return false; + if (!this.type.equals(that.type)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + public void read(TProtocol iprot) throws TException { + TField field; + iprot.readStructBegin(); + while (true) + { + field = iprot.readFieldBegin(); + if (field.type == TType.STOP) { + break; + } + switch (field.id) + { + case TYPE: + if (field.type == TType.STRING) { + this.type = iprot.readString(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); + break; + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + validate(); + } + + public void write(TProtocol oprot) throws TException { + validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (this.type != null) { + oprot.writeFieldBegin(TYPE_FIELD_DESC); + oprot.writeString(this.type); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("drop_type_args("); + boolean first = true; + + sb.append("type:"); + if (this.type == null) { + sb.append("null"); + } else { + sb.append(this.type); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws TException { + // check for required fields + // check that fields of type enum have valid values + } + + } + + public static class drop_type_result implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("drop_type_result"); + private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.BOOL, (short)0); + private static final TField O1_FIELD_DESC = new TField("o1", TType.STRUCT, (short)1); + private static final TField O2_FIELD_DESC = new TField("o2", TType.STRUCT, (short)2); + + private boolean success; + public static final int SUCCESS = 0; + private MetaException o1; + public static final int O1 = 1; + private NoSuchObjectException o2; + public static final int O2 = 2; + + private final Isset __isset = new Isset(); + private static final class Isset implements java.io.Serializable { + public boolean success = false; + } + + public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ + put(SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.BOOL))); + put(O1, new FieldMetaData("o1", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRUCT))); + put(O2, new FieldMetaData("o2", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRUCT))); + }}); + + static { + FieldMetaData.addStructMetaDataMap(drop_type_result.class, metaDataMap); + } + + public drop_type_result() { + } + + public drop_type_result( + boolean success, + MetaException o1, + NoSuchObjectException o2) + { + this(); + this.success = success; + this.__isset.success = true; + this.o1 = o1; + this.o2 = o2; + } + + /** + * Performs a deep copy on other. + */ + public drop_type_result(drop_type_result other) { + __isset.success = other.__isset.success; + this.success = other.success; + if (other.isSetO1()) { + this.o1 = new MetaException(other.o1); + } + if (other.isSetO2()) { + this.o2 = new NoSuchObjectException(other.o2); + } + } + + @Override + public drop_type_result clone() { + return new drop_type_result(this); + } + + public boolean isSuccess() { + return this.success; + } + + public void setSuccess(boolean success) { + this.success = success; + this.__isset.success = true; + } + + public void unsetSuccess() { + this.__isset.success = false; + } + + // Returns true if field success is set (has been asigned a value) and false otherwise + public boolean isSetSuccess() { + return this.__isset.success; + } + + public MetaException getO1() { + return this.o1; + } + + public void setO1(MetaException o1) { + this.o1 = o1; + } + + public void unsetO1() { + this.o1 = null; + } + + // Returns true if field o1 is set (has been asigned a value) and false otherwise + public boolean isSetO1() { + return this.o1 != null; + } + + public NoSuchObjectException getO2() { + return this.o2; + } + + public void setO2(NoSuchObjectException o2) { + this.o2 = o2; + } + + public void unsetO2() { + this.o2 = null; + } + + // Returns true if field o2 is set (has been asigned a value) and false otherwise + public boolean isSetO2() { + return this.o2 != null; + } + + public void setFieldValue(int fieldID, Object value) { + switch (fieldID) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((Boolean)value); + } + break; + + case O1: + if (value == null) { + unsetO1(); + } else { + setO1((MetaException)value); + } + break; + + case O2: + if (value == null) { + unsetO2(); + } else { + setO2((NoSuchObjectException)value); + } + break; + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + public Object getFieldValue(int fieldID) { + switch (fieldID) { + case SUCCESS: + return new Boolean(isSuccess()); + + case O1: + return getO1(); + + case O2: + return getO2(); + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise + public boolean isSet(int fieldID) { + switch (fieldID) { + case SUCCESS: + return isSetSuccess(); + case O1: + return isSetO1(); + case O2: + return isSetO2(); + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof drop_type_result) + return this.equals((drop_type_result)that); + return false; + } + + public boolean equals(drop_type_result that) { + if (that == null) + return false; + + boolean this_present_success = true; + boolean that_present_success = true; + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (this.success != that.success) + return false; + } + + boolean this_present_o1 = true && this.isSetO1(); + boolean that_present_o1 = true && that.isSetO1(); + if (this_present_o1 || that_present_o1) { + if (!(this_present_o1 && that_present_o1)) + return false; + if (!this.o1.equals(that.o1)) + return false; + } + + boolean this_present_o2 = true && this.isSetO2(); + boolean that_present_o2 = true && that.isSetO2(); + if (this_present_o2 || that_present_o2) { + if (!(this_present_o2 && that_present_o2)) + return false; + if (!this.o2.equals(that.o2)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + public void read(TProtocol iprot) throws TException { + TField field; + iprot.readStructBegin(); + while (true) + { + field = iprot.readFieldBegin(); + if (field.type == TType.STOP) { + break; + } + switch (field.id) + { + case SUCCESS: + if (field.type == TType.BOOL) { + this.success = iprot.readBool(); + this.__isset.success = true; + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case O1: + if (field.type == TType.STRUCT) { + this.o1 = new MetaException(); + this.o1.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case O2: + if (field.type == TType.STRUCT) { + this.o2 = new NoSuchObjectException(); + this.o2.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); + break; + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + validate(); + } + + public void write(TProtocol oprot) throws TException { + oprot.writeStructBegin(STRUCT_DESC); + + if (this.isSetSuccess()) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + oprot.writeBool(this.success); + oprot.writeFieldEnd(); + } else if (this.isSetO1()) { + oprot.writeFieldBegin(O1_FIELD_DESC); + this.o1.write(oprot); + oprot.writeFieldEnd(); + } else if (this.isSetO2()) { + oprot.writeFieldBegin(O2_FIELD_DESC); + this.o2.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("drop_type_result("); + boolean first = true; + + sb.append("success:"); + sb.append(this.success); + first = false; + if (!first) sb.append(", "); + sb.append("o1:"); + if (this.o1 == null) { + sb.append("null"); + } else { + sb.append(this.o1); + } + first = false; + if (!first) sb.append(", "); + sb.append("o2:"); + if (this.o2 == null) { + sb.append("null"); + } else { + sb.append(this.o2); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws TException { + // check for required fields + // check that fields of type enum have valid values + } + + } + + public static class get_type_all_args implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("get_type_all_args"); + private static final TField NAME_FIELD_DESC = new TField("name", TType.STRING, (short)1); + + private String name; + public static final int NAME = 1; + + private final Isset __isset = new Isset(); + private static final class Isset implements java.io.Serializable { + } + + public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ + put(NAME, new FieldMetaData("name", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + }}); + + static { + FieldMetaData.addStructMetaDataMap(get_type_all_args.class, metaDataMap); + } + + public get_type_all_args() { + } + + public get_type_all_args( + String name) + { + this(); + this.name = name; + } + + /** + * Performs a deep copy on other. + */ + public get_type_all_args(get_type_all_args other) { + if (other.isSetName()) { + this.name = other.name; + } + } + + @Override + public get_type_all_args clone() { + return new get_type_all_args(this); + } + + 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 asigned a value) and false otherwise + public boolean isSetName() { + return this.name != null; + } + + public void setFieldValue(int fieldID, Object value) { + switch (fieldID) { + case NAME: + if (value == null) { + unsetName(); + } else { + setName((String)value); + } + break; + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + public Object getFieldValue(int fieldID) { + switch (fieldID) { + case NAME: + return getName(); + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise + public boolean isSet(int fieldID) { + switch (fieldID) { + case NAME: + return isSetName(); + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof get_type_all_args) + return this.equals((get_type_all_args)that); + return false; + } + + public boolean equals(get_type_all_args 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() { + return 0; + } + + public void read(TProtocol iprot) throws TException { + TField field; + iprot.readStructBegin(); + while (true) + { + field = iprot.readFieldBegin(); + if (field.type == TType.STOP) { + break; + } + switch (field.id) + { + case NAME: + if (field.type == TType.STRING) { + this.name = iprot.readString(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); + break; + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + validate(); + } + + public void write(TProtocol oprot) throws TException { + validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (this.name != null) { + oprot.writeFieldBegin(NAME_FIELD_DESC); + oprot.writeString(this.name); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("get_type_all_args("); + 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 TException { + // check for required fields + // check that fields of type enum have valid values + } + + } + + public static class get_type_all_result implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("get_type_all_result"); + private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.MAP, (short)0); + private static final TField O2_FIELD_DESC = new TField("o2", TType.STRUCT, (short)1); + + private Map success; + public static final int SUCCESS = 0; + private MetaException o2; + public static final int O2 = 1; + + private final Isset __isset = new Isset(); + private static final class Isset implements java.io.Serializable { + } + + public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ + put(SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, + new MapMetaData(TType.MAP, + new FieldValueMetaData(TType.STRING), + new StructMetaData(TType.STRUCT, Type.class)))); + put(O2, new FieldMetaData("o2", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRUCT))); + }}); + + static { + FieldMetaData.addStructMetaDataMap(get_type_all_result.class, metaDataMap); + } + + public get_type_all_result() { + } + + public get_type_all_result( + Map success, + MetaException o2) + { + this(); + this.success = success; + this.o2 = o2; + } + + /** + * Performs a deep copy on other. + */ + public get_type_all_result(get_type_all_result other) { + if (other.isSetSuccess()) { + Map __this__success = new HashMap(); + for (Map.Entry other_element : other.success.entrySet()) { + + String other_element_key = other_element.getKey(); + Type other_element_value = other_element.getValue(); + + String __this__success_copy_key = other_element_key; + + Type __this__success_copy_value = new Type(other_element_value); + + __this__success.put(__this__success_copy_key, __this__success_copy_value); + } + this.success = __this__success; + } + if (other.isSetO2()) { + this.o2 = new MetaException(other.o2); + } + } + + @Override + public get_type_all_result clone() { + return new get_type_all_result(this); + } + + public int getSuccessSize() { + return (this.success == null) ? 0 : this.success.size(); + } + + public void putToSuccess(String key, Type val) { + if (this.success == null) { + this.success = new HashMap(); + } + this.success.put(key, val); + } + + public Map getSuccess() { + return this.success; + } + + public void setSuccess(Map success) { + this.success = success; + } + + public void unsetSuccess() { + this.success = null; + } + + // Returns true if field success is set (has been asigned a value) and false otherwise + public boolean isSetSuccess() { + return this.success != null; + } + + public MetaException getO2() { + return this.o2; + } + + public void setO2(MetaException o2) { + this.o2 = o2; + } + + public void unsetO2() { + this.o2 = null; + } + + // Returns true if field o2 is set (has been asigned a value) and false otherwise + public boolean isSetO2() { + return this.o2 != null; + } + + public void setFieldValue(int fieldID, Object value) { + switch (fieldID) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((Map)value); + } + break; + + case O2: + if (value == null) { + unsetO2(); + } else { + setO2((MetaException)value); + } + break; + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + public Object getFieldValue(int fieldID) { + switch (fieldID) { + case SUCCESS: + return getSuccess(); + + case O2: + return getO2(); + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise + public boolean isSet(int fieldID) { + switch (fieldID) { + case SUCCESS: + return isSetSuccess(); + case O2: + return isSetO2(); + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof get_type_all_result) + return this.equals((get_type_all_result)that); + return false; + } + + public boolean equals(get_type_all_result that) { + if (that == null) + return false; + + boolean this_present_success = true && this.isSetSuccess(); + boolean that_present_success = true && that.isSetSuccess(); + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (!this.success.equals(that.success)) + return false; + } + + boolean this_present_o2 = true && this.isSetO2(); + boolean that_present_o2 = true && that.isSetO2(); + if (this_present_o2 || that_present_o2) { + if (!(this_present_o2 && that_present_o2)) + return false; + if (!this.o2.equals(that.o2)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + public void read(TProtocol iprot) throws TException { + TField field; + iprot.readStructBegin(); + while (true) + { + field = iprot.readFieldBegin(); + if (field.type == TType.STOP) { + break; + } + switch (field.id) + { + case SUCCESS: + if (field.type == TType.MAP) { + { + TMap _map105 = iprot.readMapBegin(); + this.success = new HashMap(2*_map105.size); + for (int _i106 = 0; _i106 < _map105.size; ++_i106) + { + String _key107; + Type _val108; + _key107 = iprot.readString(); + _val108 = new Type(); + _val108.read(iprot); + this.success.put(_key107, _val108); + } + iprot.readMapEnd(); + } + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case O2: + if (field.type == TType.STRUCT) { + this.o2 = new MetaException(); + this.o2.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); + break; + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + validate(); + } + + public void write(TProtocol oprot) throws TException { + oprot.writeStructBegin(STRUCT_DESC); + + if (this.isSetSuccess()) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + { + oprot.writeMapBegin(new TMap(TType.STRING, TType.STRUCT, this.success.size())); + for (Map.Entry _iter109 : this.success.entrySet()) { + oprot.writeString(_iter109.getKey()); + _iter109.getValue().write(oprot); + } + oprot.writeMapEnd(); + } + oprot.writeFieldEnd(); + } else if (this.isSetO2()) { + oprot.writeFieldBegin(O2_FIELD_DESC); + this.o2.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("get_type_all_result("); + boolean first = true; + + sb.append("success:"); + if (this.success == null) { + sb.append("null"); + } else { + sb.append(this.success); + } + first = false; + if (!first) sb.append(", "); + sb.append("o2:"); + if (this.o2 == null) { + sb.append("null"); + } else { + sb.append(this.o2); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws TException { + // check for required fields + // check that fields of type enum have valid values + } + + } + + public static class get_fields_args implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("get_fields_args"); + private static final TField DB_NAME_FIELD_DESC = new TField("db_name", TType.STRING, (short)1); + private static final TField TABLE_NAME_FIELD_DESC = new TField("table_name", TType.STRING, (short)2); + + private String db_name; + public static final int DB_NAME = 1; + private String table_name; + public static final int TABLE_NAME = 2; + + private final Isset __isset = new Isset(); + private static final class Isset implements java.io.Serializable { + } + + public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ + put(DB_NAME, new FieldMetaData("db_name", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + put(TABLE_NAME, new FieldMetaData("table_name", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + }}); + + static { + FieldMetaData.addStructMetaDataMap(get_fields_args.class, metaDataMap); + } + + public get_fields_args() { + } + + public get_fields_args( + String db_name, + String table_name) + { + this(); + this.db_name = db_name; + this.table_name = table_name; + } + + /** + * Performs a deep copy on other. + */ + public get_fields_args(get_fields_args other) { + if (other.isSetDb_name()) { + this.db_name = other.db_name; + } + if (other.isSetTable_name()) { + this.table_name = other.table_name; + } + } + + @Override + public get_fields_args clone() { + return new get_fields_args(this); + } + + public String getDb_name() { + return this.db_name; + } + + public void setDb_name(String db_name) { + this.db_name = db_name; + } + + public void unsetDb_name() { + this.db_name = null; + } + + // Returns true if field db_name is set (has been asigned a value) and false otherwise + public boolean isSetDb_name() { + return this.db_name != null; + } + + public String getTable_name() { + return this.table_name; + } + + public void setTable_name(String table_name) { + this.table_name = table_name; + } + + public void unsetTable_name() { + this.table_name = null; + } + + // Returns true if field table_name is set (has been asigned a value) and false otherwise + public boolean isSetTable_name() { + return this.table_name != null; + } + + public void setFieldValue(int fieldID, Object value) { + switch (fieldID) { + case DB_NAME: + if (value == null) { + unsetDb_name(); + } else { + setDb_name((String)value); + } + break; + + case TABLE_NAME: + if (value == null) { + unsetTable_name(); + } else { + setTable_name((String)value); + } + break; + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + public Object getFieldValue(int fieldID) { + switch (fieldID) { + case DB_NAME: + return getDb_name(); + + case TABLE_NAME: + return getTable_name(); + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise + public boolean isSet(int fieldID) { + switch (fieldID) { + case DB_NAME: + return isSetDb_name(); + case TABLE_NAME: + return isSetTable_name(); + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof get_fields_args) + return this.equals((get_fields_args)that); + return false; + } + + public boolean equals(get_fields_args that) { + if (that == null) + 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) { + if (!(this_present_db_name && that_present_db_name)) + return false; + if (!this.db_name.equals(that.db_name)) + return false; + } + + boolean this_present_table_name = true && this.isSetTable_name(); + boolean that_present_table_name = true && that.isSetTable_name(); + if (this_present_table_name || that_present_table_name) { + if (!(this_present_table_name && that_present_table_name)) + return false; + if (!this.table_name.equals(that.table_name)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + public void read(TProtocol iprot) throws TException { + TField field; + iprot.readStructBegin(); + while (true) + { + field = iprot.readFieldBegin(); + if (field.type == TType.STOP) { + break; + } + switch (field.id) + { + case DB_NAME: + if (field.type == TType.STRING) { + this.db_name = iprot.readString(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case TABLE_NAME: + if (field.type == TType.STRING) { + this.table_name = iprot.readString(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); + break; + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + validate(); + } + + public void write(TProtocol oprot) throws TException { + validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (this.db_name != null) { + oprot.writeFieldBegin(DB_NAME_FIELD_DESC); + oprot.writeString(this.db_name); + oprot.writeFieldEnd(); + } + if (this.table_name != null) { + oprot.writeFieldBegin(TABLE_NAME_FIELD_DESC); + oprot.writeString(this.table_name); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("get_fields_args("); + boolean first = true; + + sb.append("db_name:"); + if (this.db_name == null) { + sb.append("null"); + } else { + sb.append(this.db_name); + } + first = false; + if (!first) sb.append(", "); + sb.append("table_name:"); + if (this.table_name == null) { + sb.append("null"); + } else { + sb.append(this.table_name); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws TException { + // check for required fields + // check that fields of type enum have valid values + } + + } + + public static class get_fields_result implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("get_fields_result"); + private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.LIST, (short)0); + private static final TField O1_FIELD_DESC = new TField("o1", TType.STRUCT, (short)1); + private static final TField O2_FIELD_DESC = new TField("o2", TType.STRUCT, (short)2); + private static final TField O3_FIELD_DESC = new TField("o3", TType.STRUCT, (short)3); + + private List success; + public static final int SUCCESS = 0; + private MetaException o1; + public static final int O1 = 1; + private UnknownTableException o2; + public static final int O2 = 2; + private UnknownDBException o3; + public static final int O3 = 3; + + private final Isset __isset = new Isset(); + private static final class Isset implements java.io.Serializable { + } + + public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ + put(SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, + new ListMetaData(TType.LIST, + new StructMetaData(TType.STRUCT, FieldSchema.class)))); + put(O1, new FieldMetaData("o1", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRUCT))); + put(O2, new FieldMetaData("o2", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRUCT))); + put(O3, new FieldMetaData("o3", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRUCT))); + }}); + + static { + FieldMetaData.addStructMetaDataMap(get_fields_result.class, metaDataMap); + } + + public get_fields_result() { + } + + public get_fields_result( + List success, + MetaException o1, + UnknownTableException o2, + UnknownDBException o3) + { + this(); + this.success = success; + this.o1 = o1; + this.o2 = o2; + this.o3 = o3; + } + + /** + * Performs a deep copy on other. + */ + public get_fields_result(get_fields_result other) { + if (other.isSetSuccess()) { + List __this__success = new ArrayList(); + for (FieldSchema other_element : other.success) { + __this__success.add(new FieldSchema(other_element)); + } + this.success = __this__success; + } + if (other.isSetO1()) { + this.o1 = new MetaException(other.o1); + } + if (other.isSetO2()) { + this.o2 = new UnknownTableException(other.o2); + } + if (other.isSetO3()) { + this.o3 = new UnknownDBException(other.o3); + } + } + + @Override + public get_fields_result clone() { + return new get_fields_result(this); + } + + public int getSuccessSize() { + return (this.success == null) ? 0 : this.success.size(); + } + + public java.util.Iterator getSuccessIterator() { + return (this.success == null) ? null : this.success.iterator(); + } + + public void addToSuccess(FieldSchema elem) { + if (this.success == null) { + this.success = new ArrayList(); + } + this.success.add(elem); + } + + public List getSuccess() { + return this.success; + } + + public void setSuccess(List success) { + this.success = success; + } + + public void unsetSuccess() { + this.success = null; + } + + // Returns true if field success is set (has been asigned a value) and false otherwise + public boolean isSetSuccess() { + return this.success != null; + } + + public MetaException getO1() { + return this.o1; + } + + public void setO1(MetaException o1) { + this.o1 = o1; + } + + public void unsetO1() { + this.o1 = null; + } + + // Returns true if field o1 is set (has been asigned a value) and false otherwise + public boolean isSetO1() { + return this.o1 != null; + } + + public UnknownTableException getO2() { + return this.o2; + } + + public void setO2(UnknownTableException o2) { + this.o2 = o2; + } + + public void unsetO2() { + this.o2 = null; + } + + // Returns true if field o2 is set (has been asigned a value) and false otherwise + public boolean isSetO2() { + return this.o2 != null; + } + + public UnknownDBException getO3() { + return this.o3; + } + + public void setO3(UnknownDBException o3) { + this.o3 = o3; + } + + public void unsetO3() { + this.o3 = null; + } + + // Returns true if field o3 is set (has been asigned a value) and false otherwise + public boolean isSetO3() { + return this.o3 != null; + } + + public void setFieldValue(int fieldID, Object value) { + switch (fieldID) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((List)value); + } + break; + + case O1: + if (value == null) { + unsetO1(); + } else { + setO1((MetaException)value); + } + break; + + case O2: + if (value == null) { + unsetO2(); + } else { + setO2((UnknownTableException)value); + } + break; + + case O3: + if (value == null) { + unsetO3(); + } else { + setO3((UnknownDBException)value); + } + break; + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + public Object getFieldValue(int fieldID) { + switch (fieldID) { + case SUCCESS: + return getSuccess(); + + case O1: + return getO1(); + + case O2: + return getO2(); + + case O3: + return getO3(); + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise + public boolean isSet(int fieldID) { + switch (fieldID) { + case SUCCESS: + return isSetSuccess(); + case O1: + return isSetO1(); + case O2: + return isSetO2(); + case O3: + return isSetO3(); + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof get_fields_result) + return this.equals((get_fields_result)that); + return false; + } + + public boolean equals(get_fields_result that) { + if (that == null) + return false; + + boolean this_present_success = true && this.isSetSuccess(); + boolean that_present_success = true && that.isSetSuccess(); + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (!this.success.equals(that.success)) + return false; + } + + boolean this_present_o1 = true && this.isSetO1(); + boolean that_present_o1 = true && that.isSetO1(); + if (this_present_o1 || that_present_o1) { + if (!(this_present_o1 && that_present_o1)) + return false; + if (!this.o1.equals(that.o1)) + return false; + } + + boolean this_present_o2 = true && this.isSetO2(); + boolean that_present_o2 = true && that.isSetO2(); + if (this_present_o2 || that_present_o2) { + if (!(this_present_o2 && that_present_o2)) + return false; + if (!this.o2.equals(that.o2)) + return false; + } + + boolean this_present_o3 = true && this.isSetO3(); + boolean that_present_o3 = true && that.isSetO3(); + if (this_present_o3 || that_present_o3) { + if (!(this_present_o3 && that_present_o3)) + return false; + if (!this.o3.equals(that.o3)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + public void read(TProtocol iprot) throws TException { + TField field; + iprot.readStructBegin(); + while (true) + { + field = iprot.readFieldBegin(); + if (field.type == TType.STOP) { + break; + } + switch (field.id) + { + case SUCCESS: + if (field.type == TType.LIST) { + { + TList _list110 = iprot.readListBegin(); + this.success = new ArrayList(_list110.size); + for (int _i111 = 0; _i111 < _list110.size; ++_i111) + { + FieldSchema _elem112; + _elem112 = new FieldSchema(); + _elem112.read(iprot); + this.success.add(_elem112); + } + iprot.readListEnd(); + } + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case O1: + if (field.type == TType.STRUCT) { + this.o1 = new MetaException(); + this.o1.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case O2: + if (field.type == TType.STRUCT) { + this.o2 = new UnknownTableException(); + this.o2.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case O3: + if (field.type == TType.STRUCT) { + this.o3 = new UnknownDBException(); + this.o3.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); + break; + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + validate(); + } + + public void write(TProtocol oprot) throws TException { + oprot.writeStructBegin(STRUCT_DESC); + + if (this.isSetSuccess()) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + { + oprot.writeListBegin(new TList(TType.STRUCT, this.success.size())); + for (FieldSchema _iter113 : this.success) { + _iter113.write(oprot); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } else if (this.isSetO1()) { + oprot.writeFieldBegin(O1_FIELD_DESC); + this.o1.write(oprot); + oprot.writeFieldEnd(); + } else if (this.isSetO2()) { + oprot.writeFieldBegin(O2_FIELD_DESC); + this.o2.write(oprot); + oprot.writeFieldEnd(); + } else if (this.isSetO3()) { + oprot.writeFieldBegin(O3_FIELD_DESC); + this.o3.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("get_fields_result("); + boolean first = true; + + sb.append("success:"); + if (this.success == null) { + sb.append("null"); + } else { + sb.append(this.success); + } + first = false; + if (!first) sb.append(", "); + sb.append("o1:"); + if (this.o1 == null) { + sb.append("null"); + } else { + sb.append(this.o1); + } + first = false; + if (!first) sb.append(", "); + sb.append("o2:"); + if (this.o2 == null) { + sb.append("null"); + } else { + sb.append(this.o2); + } + first = false; + if (!first) sb.append(", "); + sb.append("o3:"); + if (this.o3 == null) { + sb.append("null"); + } else { + sb.append(this.o3); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws TException { + // check for required fields + // check that fields of type enum have valid values + } + + } + + public static class get_schema_args implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("get_schema_args"); + private static final TField DB_NAME_FIELD_DESC = new TField("db_name", TType.STRING, (short)1); + private static final TField TABLE_NAME_FIELD_DESC = new TField("table_name", TType.STRING, (short)2); + + private String db_name; + public static final int DB_NAME = 1; + private String table_name; + public static final int TABLE_NAME = 2; + + private final Isset __isset = new Isset(); + private static final class Isset implements java.io.Serializable { + } + + public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ + put(DB_NAME, new FieldMetaData("db_name", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + put(TABLE_NAME, new FieldMetaData("table_name", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + }}); + + static { + FieldMetaData.addStructMetaDataMap(get_schema_args.class, metaDataMap); + } + + public get_schema_args() { + } + + public get_schema_args( + String db_name, + String table_name) + { + this(); + this.db_name = db_name; + this.table_name = table_name; + } + + /** + * Performs a deep copy on other. + */ + public get_schema_args(get_schema_args other) { + if (other.isSetDb_name()) { + this.db_name = other.db_name; + } + if (other.isSetTable_name()) { + this.table_name = other.table_name; + } + } + + @Override + public get_schema_args clone() { + return new get_schema_args(this); + } + + public String getDb_name() { + return this.db_name; + } + + public void setDb_name(String db_name) { + this.db_name = db_name; + } + + public void unsetDb_name() { + this.db_name = null; + } + + // Returns true if field db_name is set (has been asigned a value) and false otherwise + public boolean isSetDb_name() { + return this.db_name != null; + } + + public String getTable_name() { + return this.table_name; + } + + public void setTable_name(String table_name) { + this.table_name = table_name; + } + + public void unsetTable_name() { + this.table_name = null; + } + + // Returns true if field table_name is set (has been asigned a value) and false otherwise + public boolean isSetTable_name() { + return this.table_name != null; + } + + public void setFieldValue(int fieldID, Object value) { + switch (fieldID) { + case DB_NAME: + if (value == null) { + unsetDb_name(); + } else { + setDb_name((String)value); + } + break; + + case TABLE_NAME: + if (value == null) { + unsetTable_name(); + } else { + setTable_name((String)value); + } + break; + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + public Object getFieldValue(int fieldID) { + switch (fieldID) { + case DB_NAME: + return getDb_name(); + + case TABLE_NAME: + return getTable_name(); + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise + public boolean isSet(int fieldID) { + switch (fieldID) { + case DB_NAME: + return isSetDb_name(); + case TABLE_NAME: + return isSetTable_name(); + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof get_schema_args) + return this.equals((get_schema_args)that); + return false; + } + + public boolean equals(get_schema_args that) { + if (that == null) + 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) { + if (!(this_present_db_name && that_present_db_name)) + return false; + if (!this.db_name.equals(that.db_name)) + return false; + } + + boolean this_present_table_name = true && this.isSetTable_name(); + boolean that_present_table_name = true && that.isSetTable_name(); + if (this_present_table_name || that_present_table_name) { + if (!(this_present_table_name && that_present_table_name)) + return false; + if (!this.table_name.equals(that.table_name)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + public void read(TProtocol iprot) throws TException { + TField field; + iprot.readStructBegin(); + while (true) + { + field = iprot.readFieldBegin(); + if (field.type == TType.STOP) { + break; + } + switch (field.id) + { + case DB_NAME: + if (field.type == TType.STRING) { + this.db_name = iprot.readString(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case TABLE_NAME: + if (field.type == TType.STRING) { + this.table_name = iprot.readString(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); + break; + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + validate(); + } + + public void write(TProtocol oprot) throws TException { + validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (this.db_name != null) { + oprot.writeFieldBegin(DB_NAME_FIELD_DESC); + oprot.writeString(this.db_name); + oprot.writeFieldEnd(); + } + if (this.table_name != null) { + oprot.writeFieldBegin(TABLE_NAME_FIELD_DESC); + oprot.writeString(this.table_name); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("get_schema_args("); + boolean first = true; + + sb.append("db_name:"); + if (this.db_name == null) { + sb.append("null"); + } else { + sb.append(this.db_name); + } + first = false; + if (!first) sb.append(", "); + sb.append("table_name:"); + if (this.table_name == null) { + sb.append("null"); + } else { + sb.append(this.table_name); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws TException { + // check for required fields + // check that fields of type enum have valid values + } + + } + + public static class get_schema_result implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("get_schema_result"); + private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.LIST, (short)0); + private static final TField O1_FIELD_DESC = new TField("o1", TType.STRUCT, (short)1); + private static final TField O2_FIELD_DESC = new TField("o2", TType.STRUCT, (short)2); + private static final TField O3_FIELD_DESC = new TField("o3", TType.STRUCT, (short)3); + + private List success; + public static final int SUCCESS = 0; + private MetaException o1; + public static final int O1 = 1; + private UnknownTableException o2; + public static final int O2 = 2; + private UnknownDBException o3; + public static final int O3 = 3; + + private final Isset __isset = new Isset(); + private static final class Isset implements java.io.Serializable { + } + + public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ + put(SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, + new ListMetaData(TType.LIST, + new StructMetaData(TType.STRUCT, FieldSchema.class)))); + put(O1, new FieldMetaData("o1", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRUCT))); + put(O2, new FieldMetaData("o2", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRUCT))); + put(O3, new FieldMetaData("o3", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRUCT))); + }}); + + static { + FieldMetaData.addStructMetaDataMap(get_schema_result.class, metaDataMap); + } + + public get_schema_result() { + } + + public get_schema_result( + List success, + MetaException o1, + UnknownTableException o2, + UnknownDBException o3) + { + this(); + this.success = success; + this.o1 = o1; + this.o2 = o2; + this.o3 = o3; + } + + /** + * Performs a deep copy on other. + */ + public get_schema_result(get_schema_result other) { + if (other.isSetSuccess()) { + List __this__success = new ArrayList(); + for (FieldSchema other_element : other.success) { + __this__success.add(new FieldSchema(other_element)); + } + this.success = __this__success; + } + if (other.isSetO1()) { + this.o1 = new MetaException(other.o1); + } + if (other.isSetO2()) { + this.o2 = new UnknownTableException(other.o2); + } + if (other.isSetO3()) { + this.o3 = new UnknownDBException(other.o3); + } + } + + @Override + public get_schema_result clone() { + return new get_schema_result(this); + } + + public int getSuccessSize() { + return (this.success == null) ? 0 : this.success.size(); + } + + public java.util.Iterator getSuccessIterator() { + return (this.success == null) ? null : this.success.iterator(); + } + + public void addToSuccess(FieldSchema elem) { + if (this.success == null) { + this.success = new ArrayList(); + } + this.success.add(elem); + } + + public List getSuccess() { + return this.success; + } + + public void setSuccess(List success) { + this.success = success; + } + + public void unsetSuccess() { + this.success = null; + } + + // Returns true if field success is set (has been asigned a value) and false otherwise + public boolean isSetSuccess() { + return this.success != null; + } + + public MetaException getO1() { + return this.o1; + } + + public void setO1(MetaException o1) { + this.o1 = o1; + } + + public void unsetO1() { + this.o1 = null; + } + + // Returns true if field o1 is set (has been asigned a value) and false otherwise + public boolean isSetO1() { + return this.o1 != null; + } + + public UnknownTableException getO2() { + return this.o2; + } + + public void setO2(UnknownTableException o2) { + this.o2 = o2; + } + + public void unsetO2() { + this.o2 = null; + } + + // Returns true if field o2 is set (has been asigned a value) and false otherwise + public boolean isSetO2() { + return this.o2 != null; + } + + public UnknownDBException getO3() { + return this.o3; + } + + public void setO3(UnknownDBException o3) { + this.o3 = o3; + } + + public void unsetO3() { + this.o3 = null; + } + + // Returns true if field o3 is set (has been asigned a value) and false otherwise + public boolean isSetO3() { + return this.o3 != null; + } + + public void setFieldValue(int fieldID, Object value) { + switch (fieldID) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((List)value); + } + break; + + case O1: + if (value == null) { + unsetO1(); + } else { + setO1((MetaException)value); + } + break; + + case O2: + if (value == null) { + unsetO2(); + } else { + setO2((UnknownTableException)value); + } + break; + + case O3: + if (value == null) { + unsetO3(); + } else { + setO3((UnknownDBException)value); + } + break; + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + public Object getFieldValue(int fieldID) { + switch (fieldID) { + case SUCCESS: + return getSuccess(); + + case O1: + return getO1(); + + case O2: + return getO2(); + + case O3: + return getO3(); + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise + public boolean isSet(int fieldID) { + switch (fieldID) { + case SUCCESS: + return isSetSuccess(); + case O1: + return isSetO1(); + case O2: + return isSetO2(); + case O3: + return isSetO3(); + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof get_schema_result) + return this.equals((get_schema_result)that); + return false; + } + + public boolean equals(get_schema_result that) { + if (that == null) + return false; + + boolean this_present_success = true && this.isSetSuccess(); + boolean that_present_success = true && that.isSetSuccess(); + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (!this.success.equals(that.success)) + return false; + } + + boolean this_present_o1 = true && this.isSetO1(); + boolean that_present_o1 = true && that.isSetO1(); + if (this_present_o1 || that_present_o1) { + if (!(this_present_o1 && that_present_o1)) + return false; + if (!this.o1.equals(that.o1)) + return false; + } + + boolean this_present_o2 = true && this.isSetO2(); + boolean that_present_o2 = true && that.isSetO2(); + if (this_present_o2 || that_present_o2) { + if (!(this_present_o2 && that_present_o2)) + return false; + if (!this.o2.equals(that.o2)) + return false; + } + + boolean this_present_o3 = true && this.isSetO3(); + boolean that_present_o3 = true && that.isSetO3(); + if (this_present_o3 || that_present_o3) { + if (!(this_present_o3 && that_present_o3)) + return false; + if (!this.o3.equals(that.o3)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + public void read(TProtocol iprot) throws TException { + TField field; + iprot.readStructBegin(); + while (true) + { + field = iprot.readFieldBegin(); + if (field.type == TType.STOP) { + break; + } + switch (field.id) + { + case SUCCESS: + if (field.type == TType.LIST) { + { + TList _list114 = iprot.readListBegin(); + this.success = new ArrayList(_list114.size); + for (int _i115 = 0; _i115 < _list114.size; ++_i115) + { + FieldSchema _elem116; + _elem116 = new FieldSchema(); + _elem116.read(iprot); + this.success.add(_elem116); + } + iprot.readListEnd(); + } + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case O1: + if (field.type == TType.STRUCT) { + this.o1 = new MetaException(); + this.o1.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case O2: + if (field.type == TType.STRUCT) { + this.o2 = new UnknownTableException(); + this.o2.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case O3: + if (field.type == TType.STRUCT) { + this.o3 = new UnknownDBException(); + this.o3.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); + break; + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + validate(); + } + + public void write(TProtocol oprot) throws TException { + oprot.writeStructBegin(STRUCT_DESC); + + if (this.isSetSuccess()) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + { + oprot.writeListBegin(new TList(TType.STRUCT, this.success.size())); + for (FieldSchema _iter117 : this.success) { + _iter117.write(oprot); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } else if (this.isSetO1()) { + oprot.writeFieldBegin(O1_FIELD_DESC); + this.o1.write(oprot); + oprot.writeFieldEnd(); + } else if (this.isSetO2()) { + oprot.writeFieldBegin(O2_FIELD_DESC); + this.o2.write(oprot); + oprot.writeFieldEnd(); + } else if (this.isSetO3()) { + oprot.writeFieldBegin(O3_FIELD_DESC); + this.o3.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("get_schema_result("); + boolean first = true; + + sb.append("success:"); + if (this.success == null) { + sb.append("null"); + } else { + sb.append(this.success); + } + first = false; + if (!first) sb.append(", "); + sb.append("o1:"); + if (this.o1 == null) { + sb.append("null"); + } else { + sb.append(this.o1); + } + first = false; + if (!first) sb.append(", "); + sb.append("o2:"); + if (this.o2 == null) { + sb.append("null"); + } else { + sb.append(this.o2); + } + first = false; + if (!first) sb.append(", "); + sb.append("o3:"); + if (this.o3 == null) { + sb.append("null"); + } else { + sb.append(this.o3); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws TException { + // check for required fields + // check that fields of type enum have valid values + } + + } + + public static class create_table_args implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("create_table_args"); + private static final TField TBL_FIELD_DESC = new TField("tbl", TType.STRUCT, (short)1); + + private Table tbl; + public static final int TBL = 1; + + private final Isset __isset = new Isset(); + private static final class Isset implements java.io.Serializable { + } + + public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ + put(TBL, new FieldMetaData("tbl", TFieldRequirementType.DEFAULT, + new StructMetaData(TType.STRUCT, Table.class))); + }}); + + static { + FieldMetaData.addStructMetaDataMap(create_table_args.class, metaDataMap); + } + + public create_table_args() { + } + + public create_table_args( + Table tbl) + { + this(); + this.tbl = tbl; + } + + /** + * Performs a deep copy on other. + */ + public create_table_args(create_table_args other) { + if (other.isSetTbl()) { + this.tbl = new Table(other.tbl); + } + } + + @Override + public create_table_args clone() { + return new create_table_args(this); + } + + public Table getTbl() { + return this.tbl; + } + + public void setTbl(Table tbl) { + this.tbl = tbl; + } + + public void unsetTbl() { + this.tbl = null; + } + + // Returns true if field tbl is set (has been asigned a value) and false otherwise + public boolean isSetTbl() { + return this.tbl != null; + } + + public void setFieldValue(int fieldID, Object value) { + switch (fieldID) { + case TBL: + if (value == null) { + unsetTbl(); + } else { + setTbl((Table)value); + } + break; + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + public Object getFieldValue(int fieldID) { + switch (fieldID) { + case TBL: + return getTbl(); + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise + public boolean isSet(int fieldID) { + switch (fieldID) { + case TBL: + return isSetTbl(); + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof create_table_args) + return this.equals((create_table_args)that); + return false; + } + + public boolean equals(create_table_args that) { + if (that == null) + return false; + + boolean this_present_tbl = true && this.isSetTbl(); + boolean that_present_tbl = true && that.isSetTbl(); + if (this_present_tbl || that_present_tbl) { + if (!(this_present_tbl && that_present_tbl)) + return false; + if (!this.tbl.equals(that.tbl)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + public void read(TProtocol iprot) throws TException { + TField field; + iprot.readStructBegin(); + while (true) + { + field = iprot.readFieldBegin(); + if (field.type == TType.STOP) { + break; + } + switch (field.id) + { + case TBL: + if (field.type == TType.STRUCT) { + this.tbl = new Table(); + this.tbl.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); + break; + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + validate(); + } + + public void write(TProtocol oprot) throws TException { + validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (this.tbl != null) { + oprot.writeFieldBegin(TBL_FIELD_DESC); + this.tbl.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("create_table_args("); + boolean first = true; + + sb.append("tbl:"); + if (this.tbl == null) { + sb.append("null"); + } else { + sb.append(this.tbl); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws TException { + // check for required fields + // check that fields of type enum have valid values + } + + } + + public static class create_table_result implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("create_table_result"); + private static final TField O1_FIELD_DESC = new TField("o1", TType.STRUCT, (short)1); + private static final TField O2_FIELD_DESC = new TField("o2", TType.STRUCT, (short)2); + private static final TField O3_FIELD_DESC = new TField("o3", TType.STRUCT, (short)3); + private static final TField O4_FIELD_DESC = new TField("o4", TType.STRUCT, (short)4); + + private AlreadyExistsException o1; + public static final int O1 = 1; + private InvalidObjectException o2; + public static final int O2 = 2; + private MetaException o3; + public static final int O3 = 3; + private NoSuchObjectException o4; + public static final int O4 = 4; + + private final Isset __isset = new Isset(); + private static final class Isset implements java.io.Serializable { + } + + public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ + put(O1, new FieldMetaData("o1", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRUCT))); + put(O2, new FieldMetaData("o2", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRUCT))); + put(O3, new FieldMetaData("o3", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRUCT))); + put(O4, new FieldMetaData("o4", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRUCT))); + }}); + + static { + FieldMetaData.addStructMetaDataMap(create_table_result.class, metaDataMap); + } + + public create_table_result() { + } + + public create_table_result( + AlreadyExistsException o1, + InvalidObjectException o2, + MetaException o3, + NoSuchObjectException o4) + { + this(); + this.o1 = o1; + this.o2 = o2; + this.o3 = o3; + this.o4 = o4; + } + + /** + * Performs a deep copy on other. + */ + public create_table_result(create_table_result other) { + if (other.isSetO1()) { + this.o1 = new AlreadyExistsException(other.o1); + } + if (other.isSetO2()) { + this.o2 = new InvalidObjectException(other.o2); + } + if (other.isSetO3()) { + this.o3 = new MetaException(other.o3); + } + if (other.isSetO4()) { + this.o4 = new NoSuchObjectException(other.o4); + } + } + + @Override + public create_table_result clone() { + return new create_table_result(this); + } + + public AlreadyExistsException getO1() { + return this.o1; + } + + public void setO1(AlreadyExistsException o1) { + this.o1 = o1; + } + + public void unsetO1() { + this.o1 = null; + } + + // Returns true if field o1 is set (has been asigned a value) and false otherwise + public boolean isSetO1() { + return this.o1 != null; + } + + public InvalidObjectException getO2() { + return this.o2; + } + + public void setO2(InvalidObjectException o2) { + this.o2 = o2; + } + + public void unsetO2() { + this.o2 = null; + } + + // Returns true if field o2 is set (has been asigned a value) and false otherwise + public boolean isSetO2() { + return this.o2 != null; + } + + public MetaException getO3() { + return this.o3; + } + + public void setO3(MetaException o3) { + this.o3 = o3; + } + + public void unsetO3() { + this.o3 = null; + } + + // Returns true if field o3 is set (has been asigned a value) and false otherwise + public boolean isSetO3() { + return this.o3 != null; + } + + public NoSuchObjectException getO4() { + return this.o4; + } + + public void setO4(NoSuchObjectException o4) { + this.o4 = o4; + } + + public void unsetO4() { + this.o4 = null; + } + + // Returns true if field o4 is set (has been asigned a value) and false otherwise + public boolean isSetO4() { + return this.o4 != null; + } + + public void setFieldValue(int fieldID, Object value) { + switch (fieldID) { + case O1: + if (value == null) { + unsetO1(); + } else { + setO1((AlreadyExistsException)value); + } + break; + + case O2: + if (value == null) { + unsetO2(); + } else { + setO2((InvalidObjectException)value); + } + break; + + case O3: + if (value == null) { + unsetO3(); + } else { + setO3((MetaException)value); + } + break; + + case O4: + if (value == null) { + unsetO4(); + } else { + setO4((NoSuchObjectException)value); + } + break; + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + public Object getFieldValue(int fieldID) { + switch (fieldID) { + case O1: + return getO1(); + + case O2: + return getO2(); + + case O3: + return getO3(); + + case O4: + return getO4(); + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise + public boolean isSet(int fieldID) { + switch (fieldID) { + case O1: + return isSetO1(); + case O2: + return isSetO2(); + case O3: + return isSetO3(); + case O4: + return isSetO4(); + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof create_table_result) + return this.equals((create_table_result)that); + return false; + } + + public boolean equals(create_table_result that) { + if (that == null) + return false; + + boolean this_present_o1 = true && this.isSetO1(); + boolean that_present_o1 = true && that.isSetO1(); + if (this_present_o1 || that_present_o1) { + if (!(this_present_o1 && that_present_o1)) + return false; + if (!this.o1.equals(that.o1)) + return false; + } + + boolean this_present_o2 = true && this.isSetO2(); + boolean that_present_o2 = true && that.isSetO2(); + if (this_present_o2 || that_present_o2) { + if (!(this_present_o2 && that_present_o2)) + return false; + if (!this.o2.equals(that.o2)) + return false; + } + + boolean this_present_o3 = true && this.isSetO3(); + boolean that_present_o3 = true && that.isSetO3(); + if (this_present_o3 || that_present_o3) { + if (!(this_present_o3 && that_present_o3)) + return false; + if (!this.o3.equals(that.o3)) + return false; + } + + boolean this_present_o4 = true && this.isSetO4(); + boolean that_present_o4 = true && that.isSetO4(); + if (this_present_o4 || that_present_o4) { + if (!(this_present_o4 && that_present_o4)) + return false; + if (!this.o4.equals(that.o4)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + public void read(TProtocol iprot) throws TException { + TField field; + iprot.readStructBegin(); + while (true) + { + field = iprot.readFieldBegin(); + if (field.type == TType.STOP) { + break; + } + switch (field.id) + { + case O1: + if (field.type == TType.STRUCT) { + this.o1 = new AlreadyExistsException(); + this.o1.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case O2: + if (field.type == TType.STRUCT) { + this.o2 = new InvalidObjectException(); + this.o2.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case O3: + if (field.type == TType.STRUCT) { + this.o3 = new MetaException(); + this.o3.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case O4: + if (field.type == TType.STRUCT) { + this.o4 = new NoSuchObjectException(); + this.o4.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); + break; + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + validate(); + } + + public void write(TProtocol oprot) throws TException { + oprot.writeStructBegin(STRUCT_DESC); + + if (this.isSetO1()) { + oprot.writeFieldBegin(O1_FIELD_DESC); + this.o1.write(oprot); + oprot.writeFieldEnd(); + } else if (this.isSetO2()) { + oprot.writeFieldBegin(O2_FIELD_DESC); + this.o2.write(oprot); + oprot.writeFieldEnd(); + } else if (this.isSetO3()) { + oprot.writeFieldBegin(O3_FIELD_DESC); + this.o3.write(oprot); + oprot.writeFieldEnd(); + } else if (this.isSetO4()) { + oprot.writeFieldBegin(O4_FIELD_DESC); + this.o4.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("create_table_result("); + boolean first = true; + + sb.append("o1:"); + if (this.o1 == null) { + sb.append("null"); + } else { + sb.append(this.o1); + } + first = false; + if (!first) sb.append(", "); + sb.append("o2:"); + if (this.o2 == null) { + sb.append("null"); + } else { + sb.append(this.o2); + } + first = false; + if (!first) sb.append(", "); + sb.append("o3:"); + if (this.o3 == null) { + sb.append("null"); + } else { + sb.append(this.o3); + } + first = false; + if (!first) sb.append(", "); + sb.append("o4:"); + if (this.o4 == null) { + sb.append("null"); + } else { + sb.append(this.o4); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws TException { + // check for required fields + // check that fields of type enum have valid values + } + + } + + public static class drop_table_args implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("drop_table_args"); + private static final TField DBNAME_FIELD_DESC = new TField("dbname", TType.STRING, (short)1); + private static final TField NAME_FIELD_DESC = new TField("name", TType.STRING, (short)2); + private static final TField DELETE_DATA_FIELD_DESC = new TField("deleteData", TType.BOOL, (short)3); + + private String dbname; + public static final int DBNAME = 1; + private String name; + public static final int NAME = 2; + private boolean deleteData; + public static final int DELETEDATA = 3; + + private final Isset __isset = new Isset(); + private static final class Isset implements java.io.Serializable { + public boolean deleteData = false; + } + + public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ + put(DBNAME, new FieldMetaData("dbname", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + put(NAME, new FieldMetaData("name", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + put(DELETEDATA, new FieldMetaData("deleteData", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.BOOL))); + }}); + + static { + FieldMetaData.addStructMetaDataMap(drop_table_args.class, metaDataMap); + } + + public drop_table_args() { + } + + public drop_table_args( + String dbname, + String name, + boolean deleteData) + { + this(); + this.dbname = dbname; + this.name = name; + this.deleteData = deleteData; + this.__isset.deleteData = true; + } + + /** + * Performs a deep copy on other. + */ + public drop_table_args(drop_table_args other) { + if (other.isSetDbname()) { + this.dbname = other.dbname; + } + if (other.isSetName()) { + this.name = other.name; + } + __isset.deleteData = other.__isset.deleteData; + this.deleteData = other.deleteData; + } + + @Override + public drop_table_args clone() { + return new drop_table_args(this); + } + + public String getDbname() { + return this.dbname; + } + + public void setDbname(String dbname) { + this.dbname = dbname; + } + + public void unsetDbname() { + this.dbname = null; + } + + // Returns true if field dbname is set (has been asigned a value) and false otherwise + public boolean isSetDbname() { + return this.dbname != 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 asigned a value) and false otherwise + public boolean isSetName() { + return this.name != null; + } + + public boolean isDeleteData() { + return this.deleteData; + } + + public void setDeleteData(boolean deleteData) { + this.deleteData = deleteData; + this.__isset.deleteData = true; + } + + public void unsetDeleteData() { + this.__isset.deleteData = false; + } + + // Returns true if field deleteData is set (has been asigned a value) and false otherwise + public boolean isSetDeleteData() { + return this.__isset.deleteData; + } + + public void setFieldValue(int fieldID, Object value) { + switch (fieldID) { + case DBNAME: + if (value == null) { + unsetDbname(); + } else { + setDbname((String)value); + } + break; + + case NAME: + if (value == null) { + unsetName(); + } else { + setName((String)value); + } + break; + + case DELETEDATA: + if (value == null) { + unsetDeleteData(); + } else { + setDeleteData((Boolean)value); + } + break; + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + public Object getFieldValue(int fieldID) { + switch (fieldID) { + case DBNAME: + return getDbname(); + + case NAME: + return getName(); + + case DELETEDATA: + return new Boolean(isDeleteData()); + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise + public boolean isSet(int fieldID) { + switch (fieldID) { + case DBNAME: + return isSetDbname(); + case NAME: + return isSetName(); + case DELETEDATA: + return isSetDeleteData(); + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof drop_table_args) + return this.equals((drop_table_args)that); + return false; + } + + public boolean equals(drop_table_args that) { + if (that == null) + return false; + + boolean this_present_dbname = true && this.isSetDbname(); + boolean that_present_dbname = true && that.isSetDbname(); + if (this_present_dbname || that_present_dbname) { + if (!(this_present_dbname && that_present_dbname)) + return false; + if (!this.dbname.equals(that.dbname)) + 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; + } + + boolean this_present_deleteData = true; + boolean that_present_deleteData = true; + if (this_present_deleteData || that_present_deleteData) { + if (!(this_present_deleteData && that_present_deleteData)) + return false; + if (this.deleteData != that.deleteData) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + public void read(TProtocol iprot) throws TException { + TField field; + iprot.readStructBegin(); + while (true) + { + field = iprot.readFieldBegin(); + if (field.type == TType.STOP) { + break; + } + switch (field.id) + { + case DBNAME: + if (field.type == TType.STRING) { + this.dbname = iprot.readString(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case NAME: + if (field.type == TType.STRING) { + this.name = iprot.readString(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case DELETEDATA: + if (field.type == TType.BOOL) { + this.deleteData = iprot.readBool(); + this.__isset.deleteData = true; + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); + break; + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + validate(); + } + + public void write(TProtocol oprot) throws TException { + validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (this.dbname != null) { + oprot.writeFieldBegin(DBNAME_FIELD_DESC); + oprot.writeString(this.dbname); + oprot.writeFieldEnd(); + } + if (this.name != null) { + oprot.writeFieldBegin(NAME_FIELD_DESC); + oprot.writeString(this.name); + oprot.writeFieldEnd(); + } + oprot.writeFieldBegin(DELETE_DATA_FIELD_DESC); + oprot.writeBool(this.deleteData); + oprot.writeFieldEnd(); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("drop_table_args("); + boolean first = true; + + sb.append("dbname:"); + if (this.dbname == null) { + sb.append("null"); + } else { + sb.append(this.dbname); + } + first = false; + if (!first) sb.append(", "); + sb.append("name:"); + if (this.name == null) { + sb.append("null"); + } else { + sb.append(this.name); + } + first = false; + if (!first) sb.append(", "); + sb.append("deleteData:"); + sb.append(this.deleteData); + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws TException { + // check for required fields + // check that fields of type enum have valid values + } + + } + + public static class drop_table_result implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("drop_table_result"); + private static final TField O1_FIELD_DESC = new TField("o1", TType.STRUCT, (short)1); + private static final TField O3_FIELD_DESC = new TField("o3", TType.STRUCT, (short)2); + + private NoSuchObjectException o1; + public static final int O1 = 1; + private MetaException o3; + public static final int O3 = 2; + + private final Isset __isset = new Isset(); + private static final class Isset implements java.io.Serializable { + } + + public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ + put(O1, new FieldMetaData("o1", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRUCT))); + put(O3, new FieldMetaData("o3", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRUCT))); + }}); + + static { + FieldMetaData.addStructMetaDataMap(drop_table_result.class, metaDataMap); + } + + public drop_table_result() { + } + + public drop_table_result( + NoSuchObjectException o1, + MetaException o3) + { + this(); + this.o1 = o1; + this.o3 = o3; + } + + /** + * Performs a deep copy on other. + */ + public drop_table_result(drop_table_result other) { + if (other.isSetO1()) { + this.o1 = new NoSuchObjectException(other.o1); + } + if (other.isSetO3()) { + this.o3 = new MetaException(other.o3); + } + } + + @Override + public drop_table_result clone() { + return new drop_table_result(this); + } + + public NoSuchObjectException getO1() { + return this.o1; + } + + public void setO1(NoSuchObjectException o1) { + this.o1 = o1; + } + + public void unsetO1() { + this.o1 = null; + } + + // Returns true if field o1 is set (has been asigned a value) and false otherwise + public boolean isSetO1() { + return this.o1 != null; + } + + public MetaException getO3() { + return this.o3; + } + + public void setO3(MetaException o3) { + this.o3 = o3; + } + + public void unsetO3() { + this.o3 = null; + } + + // Returns true if field o3 is set (has been asigned a value) and false otherwise + public boolean isSetO3() { + return this.o3 != null; + } + + public void setFieldValue(int fieldID, Object value) { + switch (fieldID) { + case O1: + if (value == null) { + unsetO1(); + } else { + setO1((NoSuchObjectException)value); + } + break; + + case O3: + if (value == null) { + unsetO3(); + } else { + setO3((MetaException)value); + } + break; + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + public Object getFieldValue(int fieldID) { + switch (fieldID) { + case O1: + return getO1(); + + case O3: + return getO3(); + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise + public boolean isSet(int fieldID) { + switch (fieldID) { + case O1: + return isSetO1(); + case O3: + return isSetO3(); + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof drop_table_result) + return this.equals((drop_table_result)that); + return false; + } + + public boolean equals(drop_table_result that) { + if (that == null) + return false; + + boolean this_present_o1 = true && this.isSetO1(); + boolean that_present_o1 = true && that.isSetO1(); + if (this_present_o1 || that_present_o1) { + if (!(this_present_o1 && that_present_o1)) + return false; + if (!this.o1.equals(that.o1)) + return false; + } + + boolean this_present_o3 = true && this.isSetO3(); + boolean that_present_o3 = true && that.isSetO3(); + if (this_present_o3 || that_present_o3) { + if (!(this_present_o3 && that_present_o3)) + return false; + if (!this.o3.equals(that.o3)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + public void read(TProtocol iprot) throws TException { + TField field; + iprot.readStructBegin(); + while (true) + { + field = iprot.readFieldBegin(); + if (field.type == TType.STOP) { + break; + } + switch (field.id) + { + case O1: + if (field.type == TType.STRUCT) { + this.o1 = new NoSuchObjectException(); + this.o1.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case O3: + if (field.type == TType.STRUCT) { + this.o3 = new MetaException(); + this.o3.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); + break; + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + validate(); + } + + public void write(TProtocol oprot) throws TException { + oprot.writeStructBegin(STRUCT_DESC); + + if (this.isSetO1()) { + oprot.writeFieldBegin(O1_FIELD_DESC); + this.o1.write(oprot); + oprot.writeFieldEnd(); + } else if (this.isSetO3()) { + oprot.writeFieldBegin(O3_FIELD_DESC); + this.o3.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("drop_table_result("); + boolean first = true; + + sb.append("o1:"); + if (this.o1 == null) { + sb.append("null"); + } else { + sb.append(this.o1); + } + first = false; + if (!first) sb.append(", "); + sb.append("o3:"); + if (this.o3 == null) { + sb.append("null"); + } else { + sb.append(this.o3); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws TException { + // check for required fields + // check that fields of type enum have valid values + } + + } + + public static class get_tables_args implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("get_tables_args"); + private static final TField DB_NAME_FIELD_DESC = new TField("db_name", TType.STRING, (short)1); + private static final TField PATTERN_FIELD_DESC = new TField("pattern", TType.STRING, (short)2); + + private String db_name; + public static final int DB_NAME = 1; + private String pattern; + public static final int PATTERN = 2; + + private final Isset __isset = new Isset(); + private static final class Isset implements java.io.Serializable { + } + + public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ + put(DB_NAME, new FieldMetaData("db_name", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + put(PATTERN, new FieldMetaData("pattern", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + }}); + + static { + FieldMetaData.addStructMetaDataMap(get_tables_args.class, metaDataMap); + } + + public get_tables_args() { + } + + public get_tables_args( + String db_name, + String pattern) + { + this(); + this.db_name = db_name; + this.pattern = pattern; + } + + /** + * Performs a deep copy on other. + */ + public get_tables_args(get_tables_args other) { + if (other.isSetDb_name()) { + this.db_name = other.db_name; + } + if (other.isSetPattern()) { + this.pattern = other.pattern; + } + } + + @Override + public get_tables_args clone() { + return new get_tables_args(this); + } + + public String getDb_name() { + return this.db_name; + } + + public void setDb_name(String db_name) { + this.db_name = db_name; + } + + public void unsetDb_name() { + this.db_name = null; + } + + // Returns true if field db_name is set (has been asigned a value) and false otherwise + public boolean isSetDb_name() { + return this.db_name != null; + } + + public String getPattern() { + return this.pattern; + } + + public void setPattern(String pattern) { + this.pattern = pattern; + } + + public void unsetPattern() { + this.pattern = null; + } + + // Returns true if field pattern is set (has been asigned a value) and false otherwise + public boolean isSetPattern() { + return this.pattern != null; + } + + public void setFieldValue(int fieldID, Object value) { + switch (fieldID) { + case DB_NAME: + if (value == null) { + unsetDb_name(); + } else { + setDb_name((String)value); + } + break; + + case PATTERN: + if (value == null) { + unsetPattern(); + } else { + setPattern((String)value); + } + break; + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + public Object getFieldValue(int fieldID) { + switch (fieldID) { + case DB_NAME: + return getDb_name(); + + case PATTERN: + return getPattern(); + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise + public boolean isSet(int fieldID) { + switch (fieldID) { + case DB_NAME: + return isSetDb_name(); + case PATTERN: + return isSetPattern(); + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof get_tables_args) + return this.equals((get_tables_args)that); + return false; + } + + public boolean equals(get_tables_args that) { + if (that == null) + 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) { + if (!(this_present_db_name && that_present_db_name)) + return false; + if (!this.db_name.equals(that.db_name)) + return false; + } + + boolean this_present_pattern = true && this.isSetPattern(); + boolean that_present_pattern = true && that.isSetPattern(); + if (this_present_pattern || that_present_pattern) { + if (!(this_present_pattern && that_present_pattern)) + return false; + if (!this.pattern.equals(that.pattern)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + public void read(TProtocol iprot) throws TException { + TField field; + iprot.readStructBegin(); + while (true) + { + field = iprot.readFieldBegin(); + if (field.type == TType.STOP) { + break; + } + switch (field.id) + { + case DB_NAME: + if (field.type == TType.STRING) { + this.db_name = iprot.readString(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case PATTERN: + if (field.type == TType.STRING) { + this.pattern = iprot.readString(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); + break; + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + validate(); + } + + public void write(TProtocol oprot) throws TException { + validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (this.db_name != null) { + oprot.writeFieldBegin(DB_NAME_FIELD_DESC); + oprot.writeString(this.db_name); + oprot.writeFieldEnd(); + } + if (this.pattern != null) { + oprot.writeFieldBegin(PATTERN_FIELD_DESC); + oprot.writeString(this.pattern); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("get_tables_args("); + boolean first = true; + + sb.append("db_name:"); + if (this.db_name == null) { + sb.append("null"); + } else { + sb.append(this.db_name); + } + first = false; + if (!first) sb.append(", "); + sb.append("pattern:"); + if (this.pattern == null) { + sb.append("null"); + } else { + sb.append(this.pattern); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws TException { + // check for required fields + // check that fields of type enum have valid values + } + + } + + public static class get_tables_result implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("get_tables_result"); + private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.LIST, (short)0); + private static final TField O1_FIELD_DESC = new TField("o1", TType.STRUCT, (short)1); + + private List success; + public static final int SUCCESS = 0; + private MetaException o1; + public static final int O1 = 1; + + private final Isset __isset = new Isset(); + private static final class Isset implements java.io.Serializable { + } + + public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ + put(SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, + new ListMetaData(TType.LIST, + new FieldValueMetaData(TType.STRING)))); + put(O1, new FieldMetaData("o1", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRUCT))); + }}); + + static { + FieldMetaData.addStructMetaDataMap(get_tables_result.class, metaDataMap); + } + + public get_tables_result() { + } + + public get_tables_result( + List success, + MetaException o1) + { + this(); + this.success = success; + this.o1 = o1; + } + + /** + * Performs a deep copy on other. + */ + public get_tables_result(get_tables_result other) { + if (other.isSetSuccess()) { + List __this__success = new ArrayList(); + for (String other_element : other.success) { + __this__success.add(other_element); + } + this.success = __this__success; + } + if (other.isSetO1()) { + this.o1 = new MetaException(other.o1); + } + } + + @Override + public get_tables_result clone() { + return new get_tables_result(this); + } + + public int getSuccessSize() { + return (this.success == null) ? 0 : this.success.size(); + } + + public java.util.Iterator getSuccessIterator() { + return (this.success == null) ? null : this.success.iterator(); + } + + public void addToSuccess(String elem) { + if (this.success == null) { + this.success = new ArrayList(); + } + this.success.add(elem); + } + + public List getSuccess() { + return this.success; + } + + public void setSuccess(List success) { + this.success = success; + } + + public void unsetSuccess() { + this.success = null; + } + + // Returns true if field success is set (has been asigned a value) and false otherwise + public boolean isSetSuccess() { + return this.success != null; + } + + public MetaException getO1() { + return this.o1; + } + + public void setO1(MetaException o1) { + this.o1 = o1; + } + + public void unsetO1() { + this.o1 = null; + } + + // Returns true if field o1 is set (has been asigned a value) and false otherwise + public boolean isSetO1() { + return this.o1 != null; + } + + public void setFieldValue(int fieldID, Object value) { + switch (fieldID) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((List)value); + } + break; + + case O1: + if (value == null) { + unsetO1(); + } else { + setO1((MetaException)value); + } + break; + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + public Object getFieldValue(int fieldID) { + switch (fieldID) { + case SUCCESS: + return getSuccess(); + + case O1: + return getO1(); + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise + public boolean isSet(int fieldID) { + switch (fieldID) { + case SUCCESS: + return isSetSuccess(); + case O1: + return isSetO1(); + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof get_tables_result) + return this.equals((get_tables_result)that); + return false; + } + + public boolean equals(get_tables_result that) { + if (that == null) + return false; + + boolean this_present_success = true && this.isSetSuccess(); + boolean that_present_success = true && that.isSetSuccess(); + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (!this.success.equals(that.success)) + return false; + } + + boolean this_present_o1 = true && this.isSetO1(); + boolean that_present_o1 = true && that.isSetO1(); + if (this_present_o1 || that_present_o1) { + if (!(this_present_o1 && that_present_o1)) + return false; + if (!this.o1.equals(that.o1)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + public void read(TProtocol iprot) throws TException { + TField field; + iprot.readStructBegin(); + while (true) + { + field = iprot.readFieldBegin(); + if (field.type == TType.STOP) { + break; + } + switch (field.id) + { + case SUCCESS: + if (field.type == TType.LIST) { + { + TList _list118 = iprot.readListBegin(); + this.success = new ArrayList(_list118.size); + for (int _i119 = 0; _i119 < _list118.size; ++_i119) + { + String _elem120; + _elem120 = iprot.readString(); + this.success.add(_elem120); + } + iprot.readListEnd(); + } + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case O1: + if (field.type == TType.STRUCT) { + this.o1 = new MetaException(); + this.o1.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); + break; + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + validate(); + } + + public void write(TProtocol oprot) throws TException { + oprot.writeStructBegin(STRUCT_DESC); + + if (this.isSetSuccess()) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + { + oprot.writeListBegin(new TList(TType.STRING, this.success.size())); + for (String _iter121 : this.success) { + oprot.writeString(_iter121); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } else if (this.isSetO1()) { + oprot.writeFieldBegin(O1_FIELD_DESC); + this.o1.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("get_tables_result("); + boolean first = true; + + sb.append("success:"); + if (this.success == null) { + sb.append("null"); + } else { + sb.append(this.success); + } + first = false; + if (!first) sb.append(", "); + sb.append("o1:"); + if (this.o1 == null) { + sb.append("null"); + } else { + sb.append(this.o1); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws TException { + // check for required fields + // check that fields of type enum have valid values + } + + } + + public static class get_all_tables_args implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("get_all_tables_args"); + private static final TField DB_NAME_FIELD_DESC = new TField("db_name", TType.STRING, (short)1); + + private String db_name; + public static final int DB_NAME = 1; + + private final Isset __isset = new Isset(); + private static final class Isset implements java.io.Serializable { + } + + public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ + put(DB_NAME, new FieldMetaData("db_name", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + }}); + + static { + FieldMetaData.addStructMetaDataMap(get_all_tables_args.class, metaDataMap); + } + + public get_all_tables_args() { + } + + public get_all_tables_args( + String db_name) + { + this(); + this.db_name = db_name; + } + + /** + * Performs a deep copy on other. + */ + public get_all_tables_args(get_all_tables_args other) { + if (other.isSetDb_name()) { + this.db_name = other.db_name; + } + } + + @Override + public get_all_tables_args clone() { + return new get_all_tables_args(this); + } + + public String getDb_name() { + return this.db_name; + } + + public void setDb_name(String db_name) { + this.db_name = db_name; + } + + public void unsetDb_name() { + this.db_name = null; + } + + // Returns true if field db_name is set (has been asigned a value) and false otherwise + public boolean isSetDb_name() { + return this.db_name != null; + } + + public void setFieldValue(int fieldID, Object value) { + switch (fieldID) { + case DB_NAME: + if (value == null) { + unsetDb_name(); + } else { + setDb_name((String)value); + } + break; + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + public Object getFieldValue(int fieldID) { + switch (fieldID) { + case DB_NAME: + return getDb_name(); + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise + public boolean isSet(int fieldID) { + switch (fieldID) { + case DB_NAME: + return isSetDb_name(); + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof get_all_tables_args) + return this.equals((get_all_tables_args)that); + return false; + } + + public boolean equals(get_all_tables_args that) { + if (that == null) + 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) { + if (!(this_present_db_name && that_present_db_name)) + return false; + if (!this.db_name.equals(that.db_name)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + public void read(TProtocol iprot) throws TException { + TField field; + iprot.readStructBegin(); + while (true) + { + field = iprot.readFieldBegin(); + if (field.type == TType.STOP) { + break; + } + switch (field.id) + { + case DB_NAME: + if (field.type == TType.STRING) { + this.db_name = iprot.readString(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); + break; + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + validate(); + } + + public void write(TProtocol oprot) throws TException { + validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (this.db_name != null) { + oprot.writeFieldBegin(DB_NAME_FIELD_DESC); + oprot.writeString(this.db_name); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("get_all_tables_args("); + boolean first = true; + + sb.append("db_name:"); + if (this.db_name == null) { + sb.append("null"); + } else { + sb.append(this.db_name); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws TException { + // check for required fields + // check that fields of type enum have valid values + } + + } + + public static class get_all_tables_result implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("get_all_tables_result"); + private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.LIST, (short)0); + private static final TField O1_FIELD_DESC = new TField("o1", TType.STRUCT, (short)1); + + private List success; + public static final int SUCCESS = 0; + private MetaException o1; + public static final int O1 = 1; + + private final Isset __isset = new Isset(); + private static final class Isset implements java.io.Serializable { + } + + public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ + put(SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, + new ListMetaData(TType.LIST, + new FieldValueMetaData(TType.STRING)))); + put(O1, new FieldMetaData("o1", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRUCT))); + }}); + + static { + FieldMetaData.addStructMetaDataMap(get_all_tables_result.class, metaDataMap); + } + + public get_all_tables_result() { + } + + public get_all_tables_result( + List success, + MetaException o1) + { + this(); + this.success = success; + this.o1 = o1; + } + + /** + * Performs a deep copy on other. + */ + public get_all_tables_result(get_all_tables_result other) { + if (other.isSetSuccess()) { + List __this__success = new ArrayList(); + for (String other_element : other.success) { + __this__success.add(other_element); + } + this.success = __this__success; + } + if (other.isSetO1()) { + this.o1 = new MetaException(other.o1); + } + } + + @Override + public get_all_tables_result clone() { + return new get_all_tables_result(this); + } + + public int getSuccessSize() { + return (this.success == null) ? 0 : this.success.size(); + } + + public java.util.Iterator getSuccessIterator() { + return (this.success == null) ? null : this.success.iterator(); + } + + public void addToSuccess(String elem) { + if (this.success == null) { + this.success = new ArrayList(); + } + this.success.add(elem); + } + + public List getSuccess() { + return this.success; + } + + public void setSuccess(List success) { + this.success = success; + } + + public void unsetSuccess() { + this.success = null; + } + + // Returns true if field success is set (has been asigned a value) and false otherwise + public boolean isSetSuccess() { + return this.success != null; + } + + public MetaException getO1() { + return this.o1; + } + + public void setO1(MetaException o1) { + this.o1 = o1; + } + + public void unsetO1() { + this.o1 = null; + } + + // Returns true if field o1 is set (has been asigned a value) and false otherwise + public boolean isSetO1() { + return this.o1 != null; + } + + public void setFieldValue(int fieldID, Object value) { + switch (fieldID) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((List)value); + } + break; + + case O1: + if (value == null) { + unsetO1(); + } else { + setO1((MetaException)value); + } + break; + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + public Object getFieldValue(int fieldID) { + switch (fieldID) { + case SUCCESS: + return getSuccess(); + + case O1: + return getO1(); + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise + public boolean isSet(int fieldID) { + switch (fieldID) { + case SUCCESS: + return isSetSuccess(); + case O1: + return isSetO1(); + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof get_all_tables_result) + return this.equals((get_all_tables_result)that); + return false; + } + + public boolean equals(get_all_tables_result that) { + if (that == null) + return false; + + boolean this_present_success = true && this.isSetSuccess(); + boolean that_present_success = true && that.isSetSuccess(); + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (!this.success.equals(that.success)) + return false; + } + + boolean this_present_o1 = true && this.isSetO1(); + boolean that_present_o1 = true && that.isSetO1(); + if (this_present_o1 || that_present_o1) { + if (!(this_present_o1 && that_present_o1)) + return false; + if (!this.o1.equals(that.o1)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + public void read(TProtocol iprot) throws TException { + TField field; + iprot.readStructBegin(); + while (true) + { + field = iprot.readFieldBegin(); + if (field.type == TType.STOP) { + break; + } + switch (field.id) + { + case SUCCESS: + if (field.type == TType.LIST) { + { + TList _list122 = iprot.readListBegin(); + this.success = new ArrayList(_list122.size); + for (int _i123 = 0; _i123 < _list122.size; ++_i123) + { + String _elem124; + _elem124 = iprot.readString(); + this.success.add(_elem124); + } + iprot.readListEnd(); + } + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case O1: + if (field.type == TType.STRUCT) { + this.o1 = new MetaException(); + this.o1.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); + break; + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + validate(); + } + + public void write(TProtocol oprot) throws TException { + oprot.writeStructBegin(STRUCT_DESC); + + if (this.isSetSuccess()) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + { + oprot.writeListBegin(new TList(TType.STRING, this.success.size())); + for (String _iter125 : this.success) { + oprot.writeString(_iter125); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } else if (this.isSetO1()) { + oprot.writeFieldBegin(O1_FIELD_DESC); + this.o1.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("get_all_tables_result("); + boolean first = true; + + sb.append("success:"); + if (this.success == null) { + sb.append("null"); + } else { + sb.append(this.success); + } + first = false; + if (!first) sb.append(", "); + sb.append("o1:"); + if (this.o1 == null) { + sb.append("null"); + } else { + sb.append(this.o1); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws TException { + // check for required fields + // check that fields of type enum have valid values + } + + } + + public static class get_table_args implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("get_table_args"); + private static final TField DBNAME_FIELD_DESC = new TField("dbname", TType.STRING, (short)1); + private static final TField TBL_NAME_FIELD_DESC = new TField("tbl_name", TType.STRING, (short)2); + + private String dbname; + public static final int DBNAME = 1; + private String tbl_name; + public static final int TBL_NAME = 2; + + private final Isset __isset = new Isset(); + private static final class Isset implements java.io.Serializable { + } + + public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ + put(DBNAME, new FieldMetaData("dbname", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + put(TBL_NAME, new FieldMetaData("tbl_name", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + }}); + + static { + FieldMetaData.addStructMetaDataMap(get_table_args.class, metaDataMap); + } + + public get_table_args() { + } + + public get_table_args( + String dbname, + String tbl_name) + { + this(); + this.dbname = dbname; + this.tbl_name = tbl_name; + } + + /** + * Performs a deep copy on other. + */ + public get_table_args(get_table_args other) { + if (other.isSetDbname()) { + this.dbname = other.dbname; + } + if (other.isSetTbl_name()) { + this.tbl_name = other.tbl_name; + } + } + + @Override + public get_table_args clone() { + return new get_table_args(this); + } + + public String getDbname() { + return this.dbname; + } + + public void setDbname(String dbname) { + this.dbname = dbname; + } + + public void unsetDbname() { + this.dbname = null; + } + + // Returns true if field dbname is set (has been asigned a value) and false otherwise + public boolean isSetDbname() { + return this.dbname != null; + } + + public String getTbl_name() { + return this.tbl_name; + } + + public void setTbl_name(String tbl_name) { + this.tbl_name = tbl_name; + } + + public void unsetTbl_name() { + this.tbl_name = null; + } + + // Returns true if field tbl_name is set (has been asigned a value) and false otherwise + public boolean isSetTbl_name() { + return this.tbl_name != null; + } + + public void setFieldValue(int fieldID, Object value) { + switch (fieldID) { + case DBNAME: + if (value == null) { + unsetDbname(); + } else { + setDbname((String)value); + } + break; + + case TBL_NAME: + if (value == null) { + unsetTbl_name(); + } else { + setTbl_name((String)value); + } + break; + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + public Object getFieldValue(int fieldID) { + switch (fieldID) { + case DBNAME: + return getDbname(); + + case TBL_NAME: + return getTbl_name(); + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise + public boolean isSet(int fieldID) { + switch (fieldID) { + case DBNAME: + return isSetDbname(); + case TBL_NAME: + return isSetTbl_name(); + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof get_table_args) + return this.equals((get_table_args)that); + return false; + } + + public boolean equals(get_table_args that) { + if (that == null) + return false; + + boolean this_present_dbname = true && this.isSetDbname(); + boolean that_present_dbname = true && that.isSetDbname(); + if (this_present_dbname || that_present_dbname) { + if (!(this_present_dbname && that_present_dbname)) + return false; + if (!this.dbname.equals(that.dbname)) + return false; + } + + boolean this_present_tbl_name = true && this.isSetTbl_name(); + boolean that_present_tbl_name = true && that.isSetTbl_name(); + if (this_present_tbl_name || that_present_tbl_name) { + if (!(this_present_tbl_name && that_present_tbl_name)) + return false; + if (!this.tbl_name.equals(that.tbl_name)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + public void read(TProtocol iprot) throws TException { + TField field; + iprot.readStructBegin(); + while (true) + { + field = iprot.readFieldBegin(); + if (field.type == TType.STOP) { + break; + } + switch (field.id) + { + case DBNAME: + if (field.type == TType.STRING) { + this.dbname = iprot.readString(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case TBL_NAME: + if (field.type == TType.STRING) { + this.tbl_name = iprot.readString(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); + break; + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + validate(); + } + + public void write(TProtocol oprot) throws TException { + validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (this.dbname != null) { + oprot.writeFieldBegin(DBNAME_FIELD_DESC); + oprot.writeString(this.dbname); + oprot.writeFieldEnd(); + } + if (this.tbl_name != null) { + oprot.writeFieldBegin(TBL_NAME_FIELD_DESC); + oprot.writeString(this.tbl_name); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("get_table_args("); + boolean first = true; + + sb.append("dbname:"); + if (this.dbname == null) { + sb.append("null"); + } else { + sb.append(this.dbname); + } + first = false; + if (!first) sb.append(", "); + sb.append("tbl_name:"); + if (this.tbl_name == null) { + sb.append("null"); + } else { + sb.append(this.tbl_name); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws TException { + // check for required fields + // check that fields of type enum have valid values + } + + } + + public static class get_table_result implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("get_table_result"); + private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.STRUCT, (short)0); + private static final TField O1_FIELD_DESC = new TField("o1", TType.STRUCT, (short)1); + private static final TField O2_FIELD_DESC = new TField("o2", TType.STRUCT, (short)2); + + private Table success; + public static final int SUCCESS = 0; + private MetaException o1; + public static final int O1 = 1; + private NoSuchObjectException o2; + public static final int O2 = 2; + + private final Isset __isset = new Isset(); + private static final class Isset implements java.io.Serializable { + } + + public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ + put(SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, + new StructMetaData(TType.STRUCT, Table.class))); + put(O1, new FieldMetaData("o1", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRUCT))); + put(O2, new FieldMetaData("o2", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRUCT))); + }}); + + static { + FieldMetaData.addStructMetaDataMap(get_table_result.class, metaDataMap); + } + + public get_table_result() { + } + + public get_table_result( + Table success, + MetaException o1, + NoSuchObjectException o2) + { + this(); + this.success = success; + this.o1 = o1; + this.o2 = o2; + } + + /** + * Performs a deep copy on other. + */ + public get_table_result(get_table_result other) { + if (other.isSetSuccess()) { + this.success = new Table(other.success); + } + if (other.isSetO1()) { + this.o1 = new MetaException(other.o1); + } + if (other.isSetO2()) { + this.o2 = new NoSuchObjectException(other.o2); + } + } + + @Override + public get_table_result clone() { + return new get_table_result(this); + } + + public Table getSuccess() { + return this.success; + } + + public void setSuccess(Table success) { + this.success = success; + } + + public void unsetSuccess() { + this.success = null; + } + + // Returns true if field success is set (has been asigned a value) and false otherwise + public boolean isSetSuccess() { + return this.success != null; + } + + public MetaException getO1() { + return this.o1; + } + + public void setO1(MetaException o1) { + this.o1 = o1; + } + + public void unsetO1() { + this.o1 = null; + } + + // Returns true if field o1 is set (has been asigned a value) and false otherwise + public boolean isSetO1() { + return this.o1 != null; + } + + public NoSuchObjectException getO2() { + return this.o2; + } + + public void setO2(NoSuchObjectException o2) { + this.o2 = o2; + } + + public void unsetO2() { + this.o2 = null; + } + + // Returns true if field o2 is set (has been asigned a value) and false otherwise + public boolean isSetO2() { + return this.o2 != null; + } + + public void setFieldValue(int fieldID, Object value) { + switch (fieldID) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((Table)value); + } + break; + + case O1: + if (value == null) { + unsetO1(); + } else { + setO1((MetaException)value); + } + break; + + case O2: + if (value == null) { + unsetO2(); + } else { + setO2((NoSuchObjectException)value); + } + break; + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + public Object getFieldValue(int fieldID) { + switch (fieldID) { + case SUCCESS: + return getSuccess(); + + case O1: + return getO1(); + + case O2: + return getO2(); + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise + public boolean isSet(int fieldID) { + switch (fieldID) { + case SUCCESS: + return isSetSuccess(); + case O1: + return isSetO1(); + case O2: + return isSetO2(); + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof get_table_result) + return this.equals((get_table_result)that); + return false; + } + + public boolean equals(get_table_result that) { + if (that == null) + return false; + + boolean this_present_success = true && this.isSetSuccess(); + boolean that_present_success = true && that.isSetSuccess(); + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (!this.success.equals(that.success)) + return false; + } + + boolean this_present_o1 = true && this.isSetO1(); + boolean that_present_o1 = true && that.isSetO1(); + if (this_present_o1 || that_present_o1) { + if (!(this_present_o1 && that_present_o1)) + return false; + if (!this.o1.equals(that.o1)) + return false; + } + + boolean this_present_o2 = true && this.isSetO2(); + boolean that_present_o2 = true && that.isSetO2(); + if (this_present_o2 || that_present_o2) { + if (!(this_present_o2 && that_present_o2)) + return false; + if (!this.o2.equals(that.o2)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + public void read(TProtocol iprot) throws TException { + TField field; + iprot.readStructBegin(); + while (true) + { + field = iprot.readFieldBegin(); + if (field.type == TType.STOP) { + break; + } + switch (field.id) + { + case SUCCESS: + if (field.type == TType.STRUCT) { + this.success = new Table(); + this.success.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case O1: + if (field.type == TType.STRUCT) { + this.o1 = new MetaException(); + this.o1.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case O2: + if (field.type == TType.STRUCT) { + this.o2 = new NoSuchObjectException(); + this.o2.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); + break; + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + validate(); + } + + public void write(TProtocol oprot) throws TException { + oprot.writeStructBegin(STRUCT_DESC); + + if (this.isSetSuccess()) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + this.success.write(oprot); + oprot.writeFieldEnd(); + } else if (this.isSetO1()) { + oprot.writeFieldBegin(O1_FIELD_DESC); + this.o1.write(oprot); + oprot.writeFieldEnd(); + } else if (this.isSetO2()) { + oprot.writeFieldBegin(O2_FIELD_DESC); + this.o2.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("get_table_result("); + boolean first = true; + + sb.append("success:"); + if (this.success == null) { + sb.append("null"); + } else { + sb.append(this.success); + } + first = false; + if (!first) sb.append(", "); + sb.append("o1:"); + if (this.o1 == null) { + sb.append("null"); + } else { + sb.append(this.o1); + } + first = false; + if (!first) sb.append(", "); + sb.append("o2:"); + if (this.o2 == null) { + sb.append("null"); + } else { + sb.append(this.o2); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws TException { + // check for required fields + // check that fields of type enum have valid values + } + + } + + public static class alter_table_args implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("alter_table_args"); + private static final TField DBNAME_FIELD_DESC = new TField("dbname", TType.STRING, (short)1); + private static final TField TBL_NAME_FIELD_DESC = new TField("tbl_name", TType.STRING, (short)2); + private static final TField NEW_TBL_FIELD_DESC = new TField("new_tbl", TType.STRUCT, (short)3); + + private String dbname; + public static final int DBNAME = 1; + private String tbl_name; + public static final int TBL_NAME = 2; + private Table new_tbl; + public static final int NEW_TBL = 3; + + private final Isset __isset = new Isset(); + private static final class Isset implements java.io.Serializable { + } + + public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ + put(DBNAME, new FieldMetaData("dbname", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + put(TBL_NAME, new FieldMetaData("tbl_name", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + put(NEW_TBL, new FieldMetaData("new_tbl", TFieldRequirementType.DEFAULT, + new StructMetaData(TType.STRUCT, Table.class))); + }}); + + static { + FieldMetaData.addStructMetaDataMap(alter_table_args.class, metaDataMap); + } + + public alter_table_args() { + } + + public alter_table_args( + String dbname, + String tbl_name, + Table new_tbl) + { + this(); + this.dbname = dbname; + this.tbl_name = tbl_name; + this.new_tbl = new_tbl; + } + + /** + * Performs a deep copy on other. + */ + public alter_table_args(alter_table_args other) { + if (other.isSetDbname()) { + this.dbname = other.dbname; + } + if (other.isSetTbl_name()) { + this.tbl_name = other.tbl_name; + } + if (other.isSetNew_tbl()) { + this.new_tbl = new Table(other.new_tbl); + } + } + + @Override + public alter_table_args clone() { + return new alter_table_args(this); + } + + public String getDbname() { + return this.dbname; + } + + public void setDbname(String dbname) { + this.dbname = dbname; + } + + public void unsetDbname() { + this.dbname = null; + } + + // Returns true if field dbname is set (has been asigned a value) and false otherwise + public boolean isSetDbname() { + return this.dbname != null; + } + + public String getTbl_name() { + return this.tbl_name; + } + + public void setTbl_name(String tbl_name) { + this.tbl_name = tbl_name; + } + + public void unsetTbl_name() { + this.tbl_name = null; + } + + // Returns true if field tbl_name is set (has been asigned a value) and false otherwise + public boolean isSetTbl_name() { + return this.tbl_name != null; + } + + public Table getNew_tbl() { + return this.new_tbl; + } + + public void setNew_tbl(Table new_tbl) { + this.new_tbl = new_tbl; + } + + public void unsetNew_tbl() { + this.new_tbl = null; + } + + // Returns true if field new_tbl is set (has been asigned a value) and false otherwise + public boolean isSetNew_tbl() { + return this.new_tbl != null; + } + + public void setFieldValue(int fieldID, Object value) { + switch (fieldID) { + case DBNAME: + if (value == null) { + unsetDbname(); + } else { + setDbname((String)value); + } + break; + + case TBL_NAME: + if (value == null) { + unsetTbl_name(); + } else { + setTbl_name((String)value); + } + break; + + case NEW_TBL: + if (value == null) { + unsetNew_tbl(); + } else { + setNew_tbl((Table)value); + } + break; + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + public Object getFieldValue(int fieldID) { + switch (fieldID) { + case DBNAME: + return getDbname(); + + case TBL_NAME: + return getTbl_name(); + + case NEW_TBL: + return getNew_tbl(); + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise + public boolean isSet(int fieldID) { + switch (fieldID) { + case DBNAME: + return isSetDbname(); + case TBL_NAME: + return isSetTbl_name(); + case NEW_TBL: + return isSetNew_tbl(); + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof alter_table_args) + return this.equals((alter_table_args)that); + return false; + } + + public boolean equals(alter_table_args that) { + if (that == null) + return false; + + boolean this_present_dbname = true && this.isSetDbname(); + boolean that_present_dbname = true && that.isSetDbname(); + if (this_present_dbname || that_present_dbname) { + if (!(this_present_dbname && that_present_dbname)) + return false; + if (!this.dbname.equals(that.dbname)) + return false; + } + + boolean this_present_tbl_name = true && this.isSetTbl_name(); + boolean that_present_tbl_name = true && that.isSetTbl_name(); + if (this_present_tbl_name || that_present_tbl_name) { + if (!(this_present_tbl_name && that_present_tbl_name)) + return false; + if (!this.tbl_name.equals(that.tbl_name)) + return false; + } + + boolean this_present_new_tbl = true && this.isSetNew_tbl(); + boolean that_present_new_tbl = true && that.isSetNew_tbl(); + if (this_present_new_tbl || that_present_new_tbl) { + if (!(this_present_new_tbl && that_present_new_tbl)) + return false; + if (!this.new_tbl.equals(that.new_tbl)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + public void read(TProtocol iprot) throws TException { + TField field; + iprot.readStructBegin(); + while (true) + { + field = iprot.readFieldBegin(); + if (field.type == TType.STOP) { + break; + } + switch (field.id) + { + case DBNAME: + if (field.type == TType.STRING) { + this.dbname = iprot.readString(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case TBL_NAME: + if (field.type == TType.STRING) { + this.tbl_name = iprot.readString(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case NEW_TBL: + if (field.type == TType.STRUCT) { + this.new_tbl = new Table(); + this.new_tbl.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); + break; + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + validate(); + } + + public void write(TProtocol oprot) throws TException { + validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (this.dbname != null) { + oprot.writeFieldBegin(DBNAME_FIELD_DESC); + oprot.writeString(this.dbname); + oprot.writeFieldEnd(); + } + if (this.tbl_name != null) { + oprot.writeFieldBegin(TBL_NAME_FIELD_DESC); + oprot.writeString(this.tbl_name); + oprot.writeFieldEnd(); + } + if (this.new_tbl != null) { + oprot.writeFieldBegin(NEW_TBL_FIELD_DESC); + this.new_tbl.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("alter_table_args("); + boolean first = true; + + sb.append("dbname:"); + if (this.dbname == null) { + sb.append("null"); + } else { + sb.append(this.dbname); + } + first = false; + if (!first) sb.append(", "); + sb.append("tbl_name:"); + if (this.tbl_name == null) { + sb.append("null"); + } else { + sb.append(this.tbl_name); + } + first = false; + if (!first) sb.append(", "); + sb.append("new_tbl:"); + if (this.new_tbl == null) { + sb.append("null"); + } else { + sb.append(this.new_tbl); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws TException { + // check for required fields + // check that fields of type enum have valid values + } + + } + + public static class alter_table_result implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("alter_table_result"); + private static final TField O1_FIELD_DESC = new TField("o1", TType.STRUCT, (short)1); + private static final TField O2_FIELD_DESC = new TField("o2", TType.STRUCT, (short)2); + + private InvalidOperationException o1; + public static final int O1 = 1; + private MetaException o2; + public static final int O2 = 2; + + private final Isset __isset = new Isset(); + private static final class Isset implements java.io.Serializable { + } + + public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ + put(O1, new FieldMetaData("o1", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRUCT))); + put(O2, new FieldMetaData("o2", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRUCT))); + }}); + + static { + FieldMetaData.addStructMetaDataMap(alter_table_result.class, metaDataMap); + } + + public alter_table_result() { + } + + public alter_table_result( + InvalidOperationException o1, + MetaException o2) + { + this(); + this.o1 = o1; + this.o2 = o2; + } + + /** + * Performs a deep copy on other. + */ + public alter_table_result(alter_table_result other) { + if (other.isSetO1()) { + this.o1 = new InvalidOperationException(other.o1); + } + if (other.isSetO2()) { + this.o2 = new MetaException(other.o2); + } + } + + @Override + public alter_table_result clone() { + return new alter_table_result(this); + } + + public InvalidOperationException getO1() { + return this.o1; + } + + public void setO1(InvalidOperationException o1) { + this.o1 = o1; + } + + public void unsetO1() { + this.o1 = null; + } + + // Returns true if field o1 is set (has been asigned a value) and false otherwise + public boolean isSetO1() { + return this.o1 != null; + } + + public MetaException getO2() { + return this.o2; + } + + public void setO2(MetaException o2) { + this.o2 = o2; + } + + public void unsetO2() { + this.o2 = null; + } + + // Returns true if field o2 is set (has been asigned a value) and false otherwise + public boolean isSetO2() { + return this.o2 != null; + } + + public void setFieldValue(int fieldID, Object value) { + switch (fieldID) { + case O1: + if (value == null) { + unsetO1(); + } else { + setO1((InvalidOperationException)value); + } + break; + + case O2: + if (value == null) { + unsetO2(); + } else { + setO2((MetaException)value); + } + break; + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + public Object getFieldValue(int fieldID) { + switch (fieldID) { + case O1: + return getO1(); + + case O2: + return getO2(); + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise + public boolean isSet(int fieldID) { + switch (fieldID) { + case O1: + return isSetO1(); + case O2: + return isSetO2(); + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof alter_table_result) + return this.equals((alter_table_result)that); + return false; + } + + public boolean equals(alter_table_result that) { + if (that == null) + return false; + + boolean this_present_o1 = true && this.isSetO1(); + boolean that_present_o1 = true && that.isSetO1(); + if (this_present_o1 || that_present_o1) { + if (!(this_present_o1 && that_present_o1)) + return false; + if (!this.o1.equals(that.o1)) + return false; + } + + boolean this_present_o2 = true && this.isSetO2(); + boolean that_present_o2 = true && that.isSetO2(); + if (this_present_o2 || that_present_o2) { + if (!(this_present_o2 && that_present_o2)) + return false; + if (!this.o2.equals(that.o2)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + public void read(TProtocol iprot) throws TException { + TField field; + iprot.readStructBegin(); + while (true) + { + field = iprot.readFieldBegin(); + if (field.type == TType.STOP) { + break; } - oprot.writeMessageBegin(new TMessage("get_databases", TMessageType.REPLY, seqid)); - result.write(oprot); - oprot.writeMessageEnd(); - oprot.getTransport().flush(); + switch (field.id) + { + case O1: + if (field.type == TType.STRUCT) { + this.o1 = new InvalidOperationException(); + this.o1.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case O2: + if (field.type == TType.STRUCT) { + this.o2 = new MetaException(); + this.o2.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); + break; + } + iprot.readFieldEnd(); } + iprot.readStructEnd(); + validate(); } - private class get_all_databases implements ProcessFunction { - public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException - { - get_all_databases_args args = new get_all_databases_args(); - args.read(iprot); - iprot.readMessageEnd(); - get_all_databases_result result = new get_all_databases_result(); - try { - result.success = iface_.get_all_databases(); - } catch (MetaException o1) { - result.o1 = o1; - } catch (Throwable th) { - LOGGER.error("Internal error processing get_all_databases", th); - TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing get_all_databases"); - oprot.writeMessageBegin(new TMessage("get_all_databases", TMessageType.EXCEPTION, seqid)); - x.write(oprot); - oprot.writeMessageEnd(); - oprot.getTransport().flush(); - return; - } - oprot.writeMessageBegin(new TMessage("get_all_databases", TMessageType.REPLY, seqid)); - result.write(oprot); - oprot.writeMessageEnd(); - oprot.getTransport().flush(); - } + public void write(TProtocol oprot) throws TException { + oprot.writeStructBegin(STRUCT_DESC); + if (this.isSetO1()) { + oprot.writeFieldBegin(O1_FIELD_DESC); + this.o1.write(oprot); + oprot.writeFieldEnd(); + } else if (this.isSetO2()) { + oprot.writeFieldBegin(O2_FIELD_DESC); + this.o2.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); } - private class get_type implements ProcessFunction { - public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException - { - get_type_args args = new get_type_args(); - args.read(iprot); - iprot.readMessageEnd(); - get_type_result result = new get_type_result(); - try { - result.success = iface_.get_type(args.name); - } catch (MetaException o1) { - result.o1 = o1; - } catch (NoSuchObjectException o2) { - result.o2 = o2; - } catch (Throwable th) { - LOGGER.error("Internal error processing get_type", th); - TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing get_type"); - oprot.writeMessageBegin(new TMessage("get_type", TMessageType.EXCEPTION, seqid)); - x.write(oprot); - oprot.writeMessageEnd(); - oprot.getTransport().flush(); - return; - } - oprot.writeMessageBegin(new TMessage("get_type", TMessageType.REPLY, seqid)); - result.write(oprot); - oprot.writeMessageEnd(); - oprot.getTransport().flush(); + @Override + public String toString() { + StringBuilder sb = new StringBuilder("alter_table_result("); + boolean first = true; + + sb.append("o1:"); + if (this.o1 == null) { + sb.append("null"); + } else { + sb.append(this.o1); + } + first = false; + if (!first) sb.append(", "); + sb.append("o2:"); + if (this.o2 == null) { + sb.append("null"); + } else { + sb.append(this.o2); } + first = false; + sb.append(")"); + return sb.toString(); + } + public void validate() throws TException { + // check for required fields + // check that fields of type enum have valid values } - private class create_type implements ProcessFunction { - public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException - { - create_type_args args = new create_type_args(); - args.read(iprot); - iprot.readMessageEnd(); - create_type_result result = new create_type_result(); - try { - result.success = iface_.create_type(args.type); - result.__isset.success = true; - } catch (AlreadyExistsException o1) { - result.o1 = o1; - } catch (InvalidObjectException o2) { - result.o2 = o2; - } catch (MetaException o3) { - result.o3 = o3; - } catch (Throwable th) { - LOGGER.error("Internal error processing create_type", th); - TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing create_type"); - oprot.writeMessageBegin(new TMessage("create_type", TMessageType.EXCEPTION, seqid)); - x.write(oprot); - oprot.writeMessageEnd(); - oprot.getTransport().flush(); - return; - } - oprot.writeMessageBegin(new TMessage("create_type", TMessageType.REPLY, seqid)); - result.write(oprot); - oprot.writeMessageEnd(); - oprot.getTransport().flush(); - } + } - } + public static class add_partition_args implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("add_partition_args"); + private static final TField NEW_PART_FIELD_DESC = new TField("new_part", TType.STRUCT, (short)1); - private class drop_type implements ProcessFunction { - public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException - { - drop_type_args args = new drop_type_args(); - args.read(iprot); - iprot.readMessageEnd(); - drop_type_result result = new drop_type_result(); - try { - result.success = iface_.drop_type(args.type); - result.__isset.success = true; - } catch (MetaException o1) { - result.o1 = o1; - } catch (NoSuchObjectException o2) { - result.o2 = o2; - } catch (Throwable th) { - LOGGER.error("Internal error processing drop_type", th); - TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing drop_type"); - oprot.writeMessageBegin(new TMessage("drop_type", TMessageType.EXCEPTION, seqid)); - x.write(oprot); - oprot.writeMessageEnd(); - oprot.getTransport().flush(); - return; - } - oprot.writeMessageBegin(new TMessage("drop_type", TMessageType.REPLY, seqid)); - result.write(oprot); - oprot.writeMessageEnd(); - oprot.getTransport().flush(); - } + private Partition new_part; + public static final int NEW_PART = 1; + private final Isset __isset = new Isset(); + private static final class Isset implements java.io.Serializable { } - private class get_type_all implements ProcessFunction { - public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException - { - get_type_all_args args = new get_type_all_args(); - args.read(iprot); - iprot.readMessageEnd(); - get_type_all_result result = new get_type_all_result(); - try { - result.success = iface_.get_type_all(args.name); - } catch (MetaException o2) { - result.o2 = o2; - } catch (Throwable th) { - LOGGER.error("Internal error processing get_type_all", th); - TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing get_type_all"); - oprot.writeMessageBegin(new TMessage("get_type_all", TMessageType.EXCEPTION, seqid)); - x.write(oprot); - oprot.writeMessageEnd(); - oprot.getTransport().flush(); - return; - } - oprot.writeMessageBegin(new TMessage("get_type_all", TMessageType.REPLY, seqid)); - result.write(oprot); - oprot.writeMessageEnd(); - oprot.getTransport().flush(); - } + public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ + put(NEW_PART, new FieldMetaData("new_part", TFieldRequirementType.DEFAULT, + new StructMetaData(TType.STRUCT, Partition.class))); + }}); + static { + FieldMetaData.addStructMetaDataMap(add_partition_args.class, metaDataMap); } - private class get_fields implements ProcessFunction { - public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException - { - get_fields_args args = new get_fields_args(); - args.read(iprot); - iprot.readMessageEnd(); - get_fields_result result = new get_fields_result(); - try { - result.success = iface_.get_fields(args.db_name, args.table_name); - } catch (MetaException o1) { - result.o1 = o1; - } catch (UnknownTableException o2) { - result.o2 = o2; - } catch (UnknownDBException o3) { - result.o3 = o3; - } catch (Throwable th) { - LOGGER.error("Internal error processing get_fields", th); - TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing get_fields"); - oprot.writeMessageBegin(new TMessage("get_fields", TMessageType.EXCEPTION, seqid)); - x.write(oprot); - oprot.writeMessageEnd(); - oprot.getTransport().flush(); - return; - } - oprot.writeMessageBegin(new TMessage("get_fields", TMessageType.REPLY, seqid)); - result.write(oprot); - oprot.writeMessageEnd(); - oprot.getTransport().flush(); - } + public add_partition_args() { + } + public add_partition_args( + Partition new_part) + { + this(); + this.new_part = new_part; } - private class get_schema implements ProcessFunction { - public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException - { - get_schema_args args = new get_schema_args(); - args.read(iprot); - iprot.readMessageEnd(); - get_schema_result result = new get_schema_result(); - try { - result.success = iface_.get_schema(args.db_name, args.table_name); - } catch (MetaException o1) { - result.o1 = o1; - } catch (UnknownTableException o2) { - result.o2 = o2; - } catch (UnknownDBException o3) { - result.o3 = o3; - } catch (Throwable th) { - LOGGER.error("Internal error processing get_schema", th); - TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing get_schema"); - oprot.writeMessageBegin(new TMessage("get_schema", TMessageType.EXCEPTION, seqid)); - x.write(oprot); - oprot.writeMessageEnd(); - oprot.getTransport().flush(); - return; - } - oprot.writeMessageBegin(new TMessage("get_schema", TMessageType.REPLY, seqid)); - result.write(oprot); - oprot.writeMessageEnd(); - oprot.getTransport().flush(); + /** + * Performs a deep copy on other. + */ + public add_partition_args(add_partition_args other) { + if (other.isSetNew_part()) { + this.new_part = new Partition(other.new_part); } + } + @Override + public add_partition_args clone() { + return new add_partition_args(this); } - private class create_table implements ProcessFunction { - public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException - { - create_table_args args = new create_table_args(); - args.read(iprot); - iprot.readMessageEnd(); - create_table_result result = new create_table_result(); - try { - iface_.create_table(args.tbl); - } catch (AlreadyExistsException o1) { - result.o1 = o1; - } catch (InvalidObjectException o2) { - result.o2 = o2; - } catch (MetaException o3) { - result.o3 = o3; - } catch (NoSuchObjectException o4) { - result.o4 = o4; - } catch (Throwable th) { - LOGGER.error("Internal error processing create_table", th); - TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing create_table"); - oprot.writeMessageBegin(new TMessage("create_table", TMessageType.EXCEPTION, seqid)); - x.write(oprot); - oprot.writeMessageEnd(); - oprot.getTransport().flush(); - return; - } - oprot.writeMessageBegin(new TMessage("create_table", TMessageType.REPLY, seqid)); - result.write(oprot); - oprot.writeMessageEnd(); - oprot.getTransport().flush(); - } + public Partition getNew_part() { + return this.new_part; + } + public void setNew_part(Partition new_part) { + this.new_part = new_part; } - private class drop_table implements ProcessFunction { - public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException - { - drop_table_args args = new drop_table_args(); - args.read(iprot); - iprot.readMessageEnd(); - drop_table_result result = new drop_table_result(); - try { - iface_.drop_table(args.dbname, args.name, args.deleteData); - } catch (NoSuchObjectException o1) { - result.o1 = o1; - } catch (MetaException o3) { - result.o3 = o3; - } catch (Throwable th) { - LOGGER.error("Internal error processing drop_table", th); - TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing drop_table"); - oprot.writeMessageBegin(new TMessage("drop_table", TMessageType.EXCEPTION, seqid)); - x.write(oprot); - oprot.writeMessageEnd(); - oprot.getTransport().flush(); - return; + public void unsetNew_part() { + this.new_part = null; + } + + // Returns true if field new_part is set (has been asigned a value) and false otherwise + public boolean isSetNew_part() { + return this.new_part != null; + } + + public void setFieldValue(int fieldID, Object value) { + switch (fieldID) { + case NEW_PART: + if (value == null) { + unsetNew_part(); + } else { + setNew_part((Partition)value); } - oprot.writeMessageBegin(new TMessage("drop_table", TMessageType.REPLY, seqid)); - result.write(oprot); - oprot.writeMessageEnd(); - oprot.getTransport().flush(); + break; + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } + } + + public Object getFieldValue(int fieldID) { + switch (fieldID) { + case NEW_PART: + return getNew_part(); + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } } - private class get_tables implements ProcessFunction { - public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException - { - get_tables_args args = new get_tables_args(); - args.read(iprot); - iprot.readMessageEnd(); - get_tables_result result = new get_tables_result(); - try { - result.success = iface_.get_tables(args.db_name, args.pattern); - } catch (MetaException o1) { - result.o1 = o1; - } catch (Throwable th) { - LOGGER.error("Internal error processing get_tables", th); - TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing get_tables"); - oprot.writeMessageBegin(new TMessage("get_tables", TMessageType.EXCEPTION, seqid)); - x.write(oprot); - oprot.writeMessageEnd(); - oprot.getTransport().flush(); - return; - } - oprot.writeMessageBegin(new TMessage("get_tables", TMessageType.REPLY, seqid)); - result.write(oprot); - oprot.writeMessageEnd(); - oprot.getTransport().flush(); + // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise + public boolean isSet(int fieldID) { + switch (fieldID) { + case NEW_PART: + return isSetNew_part(); + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } + } + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof add_partition_args) + return this.equals((add_partition_args)that); + return false; } - private class get_all_tables implements ProcessFunction { - public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException - { - get_all_tables_args args = new get_all_tables_args(); - args.read(iprot); - iprot.readMessageEnd(); - get_all_tables_result result = new get_all_tables_result(); - try { - result.success = iface_.get_all_tables(args.db_name); - } catch (MetaException o1) { - result.o1 = o1; - } catch (Throwable th) { - LOGGER.error("Internal error processing get_all_tables", th); - TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing get_all_tables"); - oprot.writeMessageBegin(new TMessage("get_all_tables", TMessageType.EXCEPTION, seqid)); - x.write(oprot); - oprot.writeMessageEnd(); - oprot.getTransport().flush(); - return; - } - oprot.writeMessageBegin(new TMessage("get_all_tables", TMessageType.REPLY, seqid)); - result.write(oprot); - oprot.writeMessageEnd(); - oprot.getTransport().flush(); + public boolean equals(add_partition_args that) { + if (that == null) + return false; + + boolean this_present_new_part = true && this.isSetNew_part(); + boolean that_present_new_part = true && that.isSetNew_part(); + if (this_present_new_part || that_present_new_part) { + if (!(this_present_new_part && that_present_new_part)) + return false; + if (!this.new_part.equals(that.new_part)) + return false; } + return true; } - private class get_table implements ProcessFunction { - public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException + @Override + public int hashCode() { + return 0; + } + + public void read(TProtocol iprot) throws TException { + TField field; + iprot.readStructBegin(); + while (true) { - get_table_args args = new get_table_args(); - args.read(iprot); - iprot.readMessageEnd(); - get_table_result result = new get_table_result(); - try { - result.success = iface_.get_table(args.dbname, args.tbl_name); - } catch (MetaException o1) { - result.o1 = o1; - } catch (NoSuchObjectException o2) { - result.o2 = o2; - } catch (Throwable th) { - LOGGER.error("Internal error processing get_table", th); - TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing get_table"); - oprot.writeMessageBegin(new TMessage("get_table", TMessageType.EXCEPTION, seqid)); - x.write(oprot); - oprot.writeMessageEnd(); - oprot.getTransport().flush(); - return; + field = iprot.readFieldBegin(); + if (field.type == TType.STOP) { + break; } - oprot.writeMessageBegin(new TMessage("get_table", TMessageType.REPLY, seqid)); - result.write(oprot); - oprot.writeMessageEnd(); - oprot.getTransport().flush(); + switch (field.id) + { + case NEW_PART: + if (field.type == TType.STRUCT) { + this.new_part = new Partition(); + this.new_part.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); + break; + } + iprot.readFieldEnd(); } + iprot.readStructEnd(); + validate(); } - private class alter_table implements ProcessFunction { - public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException - { - alter_table_args args = new alter_table_args(); - args.read(iprot); - iprot.readMessageEnd(); - alter_table_result result = new alter_table_result(); - try { - iface_.alter_table(args.dbname, args.tbl_name, args.new_tbl); - } catch (InvalidOperationException o1) { - result.o1 = o1; - } catch (MetaException o2) { - result.o2 = o2; - } catch (Throwable th) { - LOGGER.error("Internal error processing alter_table", th); - TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing alter_table"); - oprot.writeMessageBegin(new TMessage("alter_table", TMessageType.EXCEPTION, seqid)); - x.write(oprot); - oprot.writeMessageEnd(); - oprot.getTransport().flush(); - return; - } - oprot.writeMessageBegin(new TMessage("alter_table", TMessageType.REPLY, seqid)); - result.write(oprot); - oprot.writeMessageEnd(); - oprot.getTransport().flush(); + public void write(TProtocol oprot) throws TException { + validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (this.new_part != null) { + oprot.writeFieldBegin(NEW_PART_FIELD_DESC); + this.new_part.write(oprot); + oprot.writeFieldEnd(); } - + oprot.writeFieldStop(); + oprot.writeStructEnd(); } - private class add_partition implements ProcessFunction { - public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException - { - add_partition_args args = new add_partition_args(); - args.read(iprot); - iprot.readMessageEnd(); - add_partition_result result = new add_partition_result(); - try { - result.success = iface_.add_partition(args.new_part); - } catch (InvalidObjectException o1) { - result.o1 = o1; - } catch (AlreadyExistsException o2) { - result.o2 = o2; - } catch (MetaException o3) { - result.o3 = o3; - } catch (Throwable th) { - LOGGER.error("Internal error processing add_partition", th); - TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing add_partition"); - oprot.writeMessageBegin(new TMessage("add_partition", TMessageType.EXCEPTION, seqid)); - x.write(oprot); - oprot.writeMessageEnd(); - oprot.getTransport().flush(); - return; - } - oprot.writeMessageBegin(new TMessage("add_partition", TMessageType.REPLY, seqid)); - result.write(oprot); - oprot.writeMessageEnd(); - oprot.getTransport().flush(); + @Override + public String toString() { + StringBuilder sb = new StringBuilder("add_partition_args("); + boolean first = true; + + sb.append("new_part:"); + if (this.new_part == null) { + sb.append("null"); + } else { + sb.append(this.new_part); } + first = false; + sb.append(")"); + return sb.toString(); + } + public void validate() throws TException { + // check for required fields + // check that fields of type enum have valid values } - private class append_partition implements ProcessFunction { - public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException - { - append_partition_args args = new append_partition_args(); - args.read(iprot); - iprot.readMessageEnd(); - append_partition_result result = new append_partition_result(); - try { - result.success = iface_.append_partition(args.db_name, args.tbl_name, args.part_vals); - } catch (InvalidObjectException o1) { - result.o1 = o1; - } catch (AlreadyExistsException o2) { - result.o2 = o2; - } catch (MetaException o3) { - result.o3 = o3; - } catch (Throwable th) { - LOGGER.error("Internal error processing append_partition", th); - TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing append_partition"); - oprot.writeMessageBegin(new TMessage("append_partition", TMessageType.EXCEPTION, seqid)); - x.write(oprot); - oprot.writeMessageEnd(); - oprot.getTransport().flush(); - return; - } - oprot.writeMessageBegin(new TMessage("append_partition", TMessageType.REPLY, seqid)); - result.write(oprot); - oprot.writeMessageEnd(); - oprot.getTransport().flush(); - } + } + + public static class add_partition_result implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("add_partition_result"); + private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.STRUCT, (short)0); + private static final TField O1_FIELD_DESC = new TField("o1", TType.STRUCT, (short)1); + private static final TField O2_FIELD_DESC = new TField("o2", TType.STRUCT, (short)2); + private static final TField O3_FIELD_DESC = new TField("o3", TType.STRUCT, (short)3); + + private Partition success; + public static final int SUCCESS = 0; + private InvalidObjectException o1; + public static final int O1 = 1; + private AlreadyExistsException o2; + public static final int O2 = 2; + private MetaException o3; + public static final int O3 = 3; + private final Isset __isset = new Isset(); + private static final class Isset implements java.io.Serializable { } - private class append_partition_by_name implements ProcessFunction { - public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException - { - append_partition_by_name_args args = new append_partition_by_name_args(); - args.read(iprot); - iprot.readMessageEnd(); - append_partition_by_name_result result = new append_partition_by_name_result(); - try { - result.success = iface_.append_partition_by_name(args.db_name, args.tbl_name, args.part_name); - } catch (InvalidObjectException o1) { - result.o1 = o1; - } catch (AlreadyExistsException o2) { - result.o2 = o2; - } catch (MetaException o3) { - result.o3 = o3; - } catch (Throwable th) { - LOGGER.error("Internal error processing append_partition_by_name", th); - TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing append_partition_by_name"); - oprot.writeMessageBegin(new TMessage("append_partition_by_name", TMessageType.EXCEPTION, seqid)); - x.write(oprot); - oprot.writeMessageEnd(); - oprot.getTransport().flush(); - return; - } - oprot.writeMessageBegin(new TMessage("append_partition_by_name", TMessageType.REPLY, seqid)); - result.write(oprot); - oprot.writeMessageEnd(); - oprot.getTransport().flush(); - } + public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ + put(SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, + new StructMetaData(TType.STRUCT, Partition.class))); + put(O1, new FieldMetaData("o1", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRUCT))); + put(O2, new FieldMetaData("o2", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRUCT))); + put(O3, new FieldMetaData("o3", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRUCT))); + }}); + static { + FieldMetaData.addStructMetaDataMap(add_partition_result.class, metaDataMap); } - private class drop_partition implements ProcessFunction { - public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException - { - drop_partition_args args = new drop_partition_args(); - args.read(iprot); - iprot.readMessageEnd(); - drop_partition_result result = new drop_partition_result(); - try { - result.success = iface_.drop_partition(args.db_name, args.tbl_name, args.part_vals, args.deleteData); - result.__isset.success = true; - } catch (NoSuchObjectException o1) { - result.o1 = o1; - } catch (MetaException o2) { - result.o2 = o2; - } catch (Throwable th) { - LOGGER.error("Internal error processing drop_partition", th); - TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing drop_partition"); - oprot.writeMessageBegin(new TMessage("drop_partition", TMessageType.EXCEPTION, seqid)); - x.write(oprot); - oprot.writeMessageEnd(); - oprot.getTransport().flush(); - return; - } - oprot.writeMessageBegin(new TMessage("drop_partition", TMessageType.REPLY, seqid)); - result.write(oprot); - oprot.writeMessageEnd(); - oprot.getTransport().flush(); - } + public add_partition_result() { + } + public add_partition_result( + Partition success, + InvalidObjectException o1, + AlreadyExistsException o2, + MetaException o3) + { + this(); + this.success = success; + this.o1 = o1; + this.o2 = o2; + this.o3 = o3; } - private class drop_partition_by_name implements ProcessFunction { - public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException - { - drop_partition_by_name_args args = new drop_partition_by_name_args(); - args.read(iprot); - iprot.readMessageEnd(); - drop_partition_by_name_result result = new drop_partition_by_name_result(); - try { - result.success = iface_.drop_partition_by_name(args.db_name, args.tbl_name, args.part_name, args.deleteData); - result.__isset.success = true; - } catch (NoSuchObjectException o1) { - result.o1 = o1; - } catch (MetaException o2) { - result.o2 = o2; - } catch (Throwable th) { - LOGGER.error("Internal error processing drop_partition_by_name", th); - TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing drop_partition_by_name"); - oprot.writeMessageBegin(new TMessage("drop_partition_by_name", TMessageType.EXCEPTION, seqid)); - x.write(oprot); - oprot.writeMessageEnd(); - oprot.getTransport().flush(); - return; - } - oprot.writeMessageBegin(new TMessage("drop_partition_by_name", TMessageType.REPLY, seqid)); - result.write(oprot); - oprot.writeMessageEnd(); - oprot.getTransport().flush(); + /** + * Performs a deep copy on other. + */ + public add_partition_result(add_partition_result other) { + if (other.isSetSuccess()) { + this.success = new Partition(other.success); + } + if (other.isSetO1()) { + this.o1 = new InvalidObjectException(other.o1); + } + if (other.isSetO2()) { + this.o2 = new AlreadyExistsException(other.o2); + } + if (other.isSetO3()) { + this.o3 = new MetaException(other.o3); } + } + @Override + public add_partition_result clone() { + return new add_partition_result(this); } - private class get_partition implements ProcessFunction { - public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException - { - get_partition_args args = new get_partition_args(); - args.read(iprot); - iprot.readMessageEnd(); - get_partition_result result = new get_partition_result(); - try { - result.success = iface_.get_partition(args.db_name, args.tbl_name, args.part_vals); - } catch (MetaException o1) { - result.o1 = o1; - } catch (NoSuchObjectException o2) { - result.o2 = o2; - } catch (Throwable th) { - LOGGER.error("Internal error processing get_partition", th); - TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing get_partition"); - oprot.writeMessageBegin(new TMessage("get_partition", TMessageType.EXCEPTION, seqid)); - x.write(oprot); - oprot.writeMessageEnd(); - oprot.getTransport().flush(); - return; - } - oprot.writeMessageBegin(new TMessage("get_partition", TMessageType.REPLY, seqid)); - result.write(oprot); - oprot.writeMessageEnd(); - oprot.getTransport().flush(); - } + public Partition getSuccess() { + return this.success; + } + public void setSuccess(Partition success) { + this.success = success; } - private class get_partition_by_name implements ProcessFunction { - public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException - { - get_partition_by_name_args args = new get_partition_by_name_args(); - args.read(iprot); - iprot.readMessageEnd(); - get_partition_by_name_result result = new get_partition_by_name_result(); - try { - result.success = iface_.get_partition_by_name(args.db_name, args.tbl_name, args.part_name); - } catch (MetaException o1) { - result.o1 = o1; - } catch (NoSuchObjectException o2) { - result.o2 = o2; - } catch (Throwable th) { - LOGGER.error("Internal error processing get_partition_by_name", th); - TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing get_partition_by_name"); - oprot.writeMessageBegin(new TMessage("get_partition_by_name", TMessageType.EXCEPTION, seqid)); - x.write(oprot); - oprot.writeMessageEnd(); - oprot.getTransport().flush(); - return; - } - oprot.writeMessageBegin(new TMessage("get_partition_by_name", TMessageType.REPLY, seqid)); - result.write(oprot); - oprot.writeMessageEnd(); - oprot.getTransport().flush(); - } + public void unsetSuccess() { + this.success = null; + } + // Returns true if field success is set (has been asigned a value) and false otherwise + public boolean isSetSuccess() { + return this.success != null; } - private class get_partitions implements ProcessFunction { - public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException - { - get_partitions_args args = new get_partitions_args(); - args.read(iprot); - iprot.readMessageEnd(); - get_partitions_result result = new get_partitions_result(); - try { - result.success = iface_.get_partitions(args.db_name, args.tbl_name, args.max_parts); - } catch (NoSuchObjectException o1) { - result.o1 = o1; - } catch (MetaException o2) { - result.o2 = o2; - } catch (Throwable th) { - LOGGER.error("Internal error processing get_partitions", th); - TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing get_partitions"); - oprot.writeMessageBegin(new TMessage("get_partitions", TMessageType.EXCEPTION, seqid)); - x.write(oprot); - oprot.writeMessageEnd(); - oprot.getTransport().flush(); - return; - } - oprot.writeMessageBegin(new TMessage("get_partitions", TMessageType.REPLY, seqid)); - result.write(oprot); - oprot.writeMessageEnd(); - oprot.getTransport().flush(); - } + public InvalidObjectException getO1() { + return this.o1; + } + public void setO1(InvalidObjectException o1) { + this.o1 = o1; } - private class get_partition_names implements ProcessFunction { - public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException - { - get_partition_names_args args = new get_partition_names_args(); - args.read(iprot); - iprot.readMessageEnd(); - get_partition_names_result result = new get_partition_names_result(); - try { - result.success = iface_.get_partition_names(args.db_name, args.tbl_name, args.max_parts); - } catch (MetaException o2) { - result.o2 = o2; - } catch (Throwable th) { - LOGGER.error("Internal error processing get_partition_names", th); - TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing get_partition_names"); - oprot.writeMessageBegin(new TMessage("get_partition_names", TMessageType.EXCEPTION, seqid)); - x.write(oprot); - oprot.writeMessageEnd(); - oprot.getTransport().flush(); - return; - } - oprot.writeMessageBegin(new TMessage("get_partition_names", TMessageType.REPLY, seqid)); - result.write(oprot); - oprot.writeMessageEnd(); - oprot.getTransport().flush(); - } + public void unsetO1() { + this.o1 = null; + } + // Returns true if field o1 is set (has been asigned a value) and false otherwise + public boolean isSetO1() { + return this.o1 != null; } - private class get_partitions_ps implements ProcessFunction { - public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException - { - get_partitions_ps_args args = new get_partitions_ps_args(); - args.read(iprot); - iprot.readMessageEnd(); - get_partitions_ps_result result = new get_partitions_ps_result(); - try { - result.success = iface_.get_partitions_ps(args.db_name, args.tbl_name, args.part_vals, args.max_parts); - } catch (MetaException o1) { - result.o1 = o1; - } catch (Throwable th) { - LOGGER.error("Internal error processing get_partitions_ps", th); - TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing get_partitions_ps"); - oprot.writeMessageBegin(new TMessage("get_partitions_ps", TMessageType.EXCEPTION, seqid)); - x.write(oprot); - oprot.writeMessageEnd(); - oprot.getTransport().flush(); - return; - } - oprot.writeMessageBegin(new TMessage("get_partitions_ps", TMessageType.REPLY, seqid)); - result.write(oprot); - oprot.writeMessageEnd(); - oprot.getTransport().flush(); - } + public AlreadyExistsException getO2() { + return this.o2; + } + public void setO2(AlreadyExistsException o2) { + this.o2 = o2; } - private class get_partition_names_ps implements ProcessFunction { - public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException - { - get_partition_names_ps_args args = new get_partition_names_ps_args(); - args.read(iprot); - iprot.readMessageEnd(); - get_partition_names_ps_result result = new get_partition_names_ps_result(); - try { - result.success = iface_.get_partition_names_ps(args.db_name, args.tbl_name, args.part_vals, args.max_parts); - } catch (MetaException o1) { - result.o1 = o1; - } catch (Throwable th) { - LOGGER.error("Internal error processing get_partition_names_ps", th); - TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing get_partition_names_ps"); - oprot.writeMessageBegin(new TMessage("get_partition_names_ps", TMessageType.EXCEPTION, seqid)); - x.write(oprot); - oprot.writeMessageEnd(); - oprot.getTransport().flush(); - return; - } - oprot.writeMessageBegin(new TMessage("get_partition_names_ps", TMessageType.REPLY, seqid)); - result.write(oprot); - oprot.writeMessageEnd(); - oprot.getTransport().flush(); - } + public void unsetO2() { + this.o2 = null; + } + // Returns true if field o2 is set (has been asigned a value) and false otherwise + public boolean isSetO2() { + return this.o2 != null; } - private class get_partitions_by_filter implements ProcessFunction { - public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException - { - get_partitions_by_filter_args args = new get_partitions_by_filter_args(); - args.read(iprot); - iprot.readMessageEnd(); - get_partitions_by_filter_result result = new get_partitions_by_filter_result(); - try { - result.success = iface_.get_partitions_by_filter(args.db_name, args.tbl_name, args.filter, args.max_parts); - } catch (MetaException o1) { - result.o1 = o1; - } catch (NoSuchObjectException o2) { - result.o2 = o2; - } catch (Throwable th) { - LOGGER.error("Internal error processing get_partitions_by_filter", th); - TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing get_partitions_by_filter"); - oprot.writeMessageBegin(new TMessage("get_partitions_by_filter", TMessageType.EXCEPTION, seqid)); - x.write(oprot); - oprot.writeMessageEnd(); - oprot.getTransport().flush(); - return; - } - oprot.writeMessageBegin(new TMessage("get_partitions_by_filter", TMessageType.REPLY, seqid)); - result.write(oprot); - oprot.writeMessageEnd(); - oprot.getTransport().flush(); - } + public MetaException getO3() { + return this.o3; + } + public void setO3(MetaException o3) { + this.o3 = o3; } - private class alter_partition implements ProcessFunction { - public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException - { - alter_partition_args args = new alter_partition_args(); - args.read(iprot); - iprot.readMessageEnd(); - alter_partition_result result = new alter_partition_result(); - try { - iface_.alter_partition(args.db_name, args.tbl_name, args.new_part); - } catch (InvalidOperationException o1) { - result.o1 = o1; - } catch (MetaException o2) { - result.o2 = o2; - } catch (Throwable th) { - LOGGER.error("Internal error processing alter_partition", th); - TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing alter_partition"); - oprot.writeMessageBegin(new TMessage("alter_partition", TMessageType.EXCEPTION, seqid)); - x.write(oprot); - oprot.writeMessageEnd(); - oprot.getTransport().flush(); - return; - } - oprot.writeMessageBegin(new TMessage("alter_partition", TMessageType.REPLY, seqid)); - result.write(oprot); - oprot.writeMessageEnd(); - oprot.getTransport().flush(); - } + public void unsetO3() { + this.o3 = null; + } + // Returns true if field o3 is set (has been asigned a value) and false otherwise + public boolean isSetO3() { + return this.o3 != null; } - private class get_config_value implements ProcessFunction { - public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException - { - get_config_value_args args = new get_config_value_args(); - args.read(iprot); - iprot.readMessageEnd(); - get_config_value_result result = new get_config_value_result(); - try { - result.success = iface_.get_config_value(args.name, args.defaultValue); - } catch (ConfigValSecurityException o1) { - result.o1 = o1; - } catch (Throwable th) { - LOGGER.error("Internal error processing get_config_value", th); - TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing get_config_value"); - oprot.writeMessageBegin(new TMessage("get_config_value", TMessageType.EXCEPTION, seqid)); - x.write(oprot); - oprot.writeMessageEnd(); - oprot.getTransport().flush(); - return; + public void setFieldValue(int fieldID, Object value) { + switch (fieldID) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((Partition)value); + } + break; + + case O1: + if (value == null) { + unsetO1(); + } else { + setO1((InvalidObjectException)value); } - oprot.writeMessageBegin(new TMessage("get_config_value", TMessageType.REPLY, seqid)); - result.write(oprot); - oprot.writeMessageEnd(); - oprot.getTransport().flush(); - } + break; - } + case O2: + if (value == null) { + unsetO2(); + } else { + setO2((AlreadyExistsException)value); + } + break; - private class partition_name_to_vals implements ProcessFunction { - public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException - { - partition_name_to_vals_args args = new partition_name_to_vals_args(); - args.read(iprot); - iprot.readMessageEnd(); - partition_name_to_vals_result result = new partition_name_to_vals_result(); - try { - result.success = iface_.partition_name_to_vals(args.part_name); - } catch (MetaException o1) { - result.o1 = o1; - } catch (Throwable th) { - LOGGER.error("Internal error processing partition_name_to_vals", th); - TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing partition_name_to_vals"); - oprot.writeMessageBegin(new TMessage("partition_name_to_vals", TMessageType.EXCEPTION, seqid)); - x.write(oprot); - oprot.writeMessageEnd(); - oprot.getTransport().flush(); - return; + case O3: + if (value == null) { + unsetO3(); + } else { + setO3((MetaException)value); } - oprot.writeMessageBegin(new TMessage("partition_name_to_vals", TMessageType.REPLY, seqid)); - result.write(oprot); - oprot.writeMessageEnd(); - oprot.getTransport().flush(); + break; + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } + } + + public Object getFieldValue(int fieldID) { + switch (fieldID) { + case SUCCESS: + return getSuccess(); + + case O1: + return getO1(); + + case O2: + return getO2(); + + case O3: + return getO3(); + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } } - private class partition_name_to_spec implements ProcessFunction { - public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException - { - partition_name_to_spec_args args = new partition_name_to_spec_args(); - args.read(iprot); - iprot.readMessageEnd(); - partition_name_to_spec_result result = new partition_name_to_spec_result(); - try { - result.success = iface_.partition_name_to_spec(args.part_name); - } catch (MetaException o1) { - result.o1 = o1; - } catch (Throwable th) { - LOGGER.error("Internal error processing partition_name_to_spec", th); - TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing partition_name_to_spec"); - oprot.writeMessageBegin(new TMessage("partition_name_to_spec", TMessageType.EXCEPTION, seqid)); - x.write(oprot); - oprot.writeMessageEnd(); - oprot.getTransport().flush(); - return; - } - oprot.writeMessageBegin(new TMessage("partition_name_to_spec", TMessageType.REPLY, seqid)); - result.write(oprot); - oprot.writeMessageEnd(); - oprot.getTransport().flush(); + // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise + public boolean isSet(int fieldID) { + switch (fieldID) { + case SUCCESS: + return isSetSuccess(); + case O1: + return isSetO1(); + case O2: + return isSetO2(); + case O3: + return isSetO3(); + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } + } + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof add_partition_result) + return this.equals((add_partition_result)that); + return false; } - private class add_index implements ProcessFunction { - public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException - { - add_index_args args = new add_index_args(); - args.read(iprot); - iprot.readMessageEnd(); - add_index_result result = new add_index_result(); - try { - result.success = iface_.add_index(args.new_index, args.index_table); - } catch (InvalidObjectException o1) { - result.o1 = o1; - } catch (AlreadyExistsException o2) { - result.o2 = o2; - } catch (MetaException o3) { - result.o3 = o3; - } catch (Throwable th) { - LOGGER.error("Internal error processing add_index", th); - TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing add_index"); - oprot.writeMessageBegin(new TMessage("add_index", TMessageType.EXCEPTION, seqid)); - x.write(oprot); - oprot.writeMessageEnd(); - oprot.getTransport().flush(); - return; - } - oprot.writeMessageBegin(new TMessage("add_index", TMessageType.REPLY, seqid)); - result.write(oprot); - oprot.writeMessageEnd(); - oprot.getTransport().flush(); + public boolean equals(add_partition_result that) { + if (that == null) + return false; + + boolean this_present_success = true && this.isSetSuccess(); + boolean that_present_success = true && that.isSetSuccess(); + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (!this.success.equals(that.success)) + return false; } - } + boolean this_present_o1 = true && this.isSetO1(); + boolean that_present_o1 = true && that.isSetO1(); + if (this_present_o1 || that_present_o1) { + if (!(this_present_o1 && that_present_o1)) + return false; + if (!this.o1.equals(that.o1)) + return false; + } - private class drop_index_by_name implements ProcessFunction { - public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException - { - drop_index_by_name_args args = new drop_index_by_name_args(); - args.read(iprot); - iprot.readMessageEnd(); - drop_index_by_name_result result = new drop_index_by_name_result(); - try { - result.success = iface_.drop_index_by_name(args.db_name, args.tbl_name, args.index_name, args.deleteData); - result.__isset.success = true; - } catch (NoSuchObjectException o1) { - result.o1 = o1; - } catch (MetaException o2) { - result.o2 = o2; - } catch (Throwable th) { - LOGGER.error("Internal error processing drop_index_by_name", th); - TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing drop_index_by_name"); - oprot.writeMessageBegin(new TMessage("drop_index_by_name", TMessageType.EXCEPTION, seqid)); - x.write(oprot); - oprot.writeMessageEnd(); - oprot.getTransport().flush(); - return; - } - oprot.writeMessageBegin(new TMessage("drop_index_by_name", TMessageType.REPLY, seqid)); - result.write(oprot); - oprot.writeMessageEnd(); - oprot.getTransport().flush(); + boolean this_present_o2 = true && this.isSetO2(); + boolean that_present_o2 = true && that.isSetO2(); + if (this_present_o2 || that_present_o2) { + if (!(this_present_o2 && that_present_o2)) + return false; + if (!this.o2.equals(that.o2)) + return false; + } + + boolean this_present_o3 = true && this.isSetO3(); + boolean that_present_o3 = true && that.isSetO3(); + if (this_present_o3 || that_present_o3) { + if (!(this_present_o3 && that_present_o3)) + return false; + if (!this.o3.equals(that.o3)) + return false; } + return true; } - private class get_index_by_name implements ProcessFunction { - public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException + @Override + public int hashCode() { + return 0; + } + + public void read(TProtocol iprot) throws TException { + TField field; + iprot.readStructBegin(); + while (true) { - get_index_by_name_args args = new get_index_by_name_args(); - args.read(iprot); - iprot.readMessageEnd(); - get_index_by_name_result result = new get_index_by_name_result(); - try { - result.success = iface_.get_index_by_name(args.db_name, args.tbl_name, args.index_name); - } catch (MetaException o1) { - result.o1 = o1; - } catch (NoSuchObjectException o2) { - result.o2 = o2; - } catch (Throwable th) { - LOGGER.error("Internal error processing get_index_by_name", th); - TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing get_index_by_name"); - oprot.writeMessageBegin(new TMessage("get_index_by_name", TMessageType.EXCEPTION, seqid)); - x.write(oprot); - oprot.writeMessageEnd(); - oprot.getTransport().flush(); - return; + field = iprot.readFieldBegin(); + if (field.type == TType.STOP) { + break; + } + switch (field.id) + { + case SUCCESS: + if (field.type == TType.STRUCT) { + this.success = new Partition(); + this.success.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case O1: + if (field.type == TType.STRUCT) { + this.o1 = new InvalidObjectException(); + this.o1.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case O2: + if (field.type == TType.STRUCT) { + this.o2 = new AlreadyExistsException(); + this.o2.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case O3: + if (field.type == TType.STRUCT) { + this.o3 = new MetaException(); + this.o3.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); + break; } - oprot.writeMessageBegin(new TMessage("get_index_by_name", TMessageType.REPLY, seqid)); - result.write(oprot); - oprot.writeMessageEnd(); - oprot.getTransport().flush(); + iprot.readFieldEnd(); } + iprot.readStructEnd(); + validate(); } - private class get_indexes implements ProcessFunction { - public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException - { - get_indexes_args args = new get_indexes_args(); - args.read(iprot); - iprot.readMessageEnd(); - get_indexes_result result = new get_indexes_result(); - try { - result.success = iface_.get_indexes(args.db_name, args.tbl_name, args.max_indexes); - } catch (NoSuchObjectException o1) { - result.o1 = o1; - } catch (MetaException o2) { - result.o2 = o2; - } catch (Throwable th) { - LOGGER.error("Internal error processing get_indexes", th); - TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing get_indexes"); - oprot.writeMessageBegin(new TMessage("get_indexes", TMessageType.EXCEPTION, seqid)); - x.write(oprot); - oprot.writeMessageEnd(); - oprot.getTransport().flush(); - return; - } - oprot.writeMessageBegin(new TMessage("get_indexes", TMessageType.REPLY, seqid)); - result.write(oprot); - oprot.writeMessageEnd(); - oprot.getTransport().flush(); - } + public void write(TProtocol oprot) throws TException { + oprot.writeStructBegin(STRUCT_DESC); + if (this.isSetSuccess()) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + this.success.write(oprot); + oprot.writeFieldEnd(); + } else if (this.isSetO1()) { + oprot.writeFieldBegin(O1_FIELD_DESC); + this.o1.write(oprot); + oprot.writeFieldEnd(); + } else if (this.isSetO2()) { + oprot.writeFieldBegin(O2_FIELD_DESC); + this.o2.write(oprot); + oprot.writeFieldEnd(); + } else if (this.isSetO3()) { + oprot.writeFieldBegin(O3_FIELD_DESC); + this.o3.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); } - private class get_index_names implements ProcessFunction { - public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException - { - get_index_names_args args = new get_index_names_args(); - args.read(iprot); - iprot.readMessageEnd(); - get_index_names_result result = new get_index_names_result(); - try { - result.success = iface_.get_index_names(args.db_name, args.tbl_name, args.max_indexes); - } catch (MetaException o2) { - result.o2 = o2; - } catch (Throwable th) { - LOGGER.error("Internal error processing get_index_names", th); - TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing get_index_names"); - oprot.writeMessageBegin(new TMessage("get_index_names", TMessageType.EXCEPTION, seqid)); - x.write(oprot); - oprot.writeMessageEnd(); - oprot.getTransport().flush(); - return; - } - oprot.writeMessageBegin(new TMessage("get_index_names", TMessageType.REPLY, seqid)); - result.write(oprot); - oprot.writeMessageEnd(); - oprot.getTransport().flush(); + @Override + public String toString() { + StringBuilder sb = new StringBuilder("add_partition_result("); + boolean first = true; + + sb.append("success:"); + if (this.success == null) { + sb.append("null"); + } else { + sb.append(this.success); + } + first = false; + if (!first) sb.append(", "); + sb.append("o1:"); + if (this.o1 == null) { + sb.append("null"); + } else { + sb.append(this.o1); + } + first = false; + if (!first) sb.append(", "); + sb.append("o2:"); + if (this.o2 == null) { + sb.append("null"); + } else { + sb.append(this.o2); + } + first = false; + if (!first) sb.append(", "); + sb.append("o3:"); + if (this.o3 == null) { + sb.append("null"); + } else { + sb.append(this.o3); } + first = false; + sb.append(")"); + return sb.toString(); + } + public void validate() throws TException { + // check for required fields + // check that fields of type enum have valid values } } - public static class create_database_args implements TBase, java.io.Serializable, Cloneable { - private static final TStruct STRUCT_DESC = new TStruct("create_database_args"); - private static final TField DATABASE_FIELD_DESC = new TField("database", TType.STRUCT, (short)1); + public static class append_partition_args implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("append_partition_args"); + private static final TField DB_NAME_FIELD_DESC = new TField("db_name", TType.STRING, (short)1); + private static final TField TBL_NAME_FIELD_DESC = new TField("tbl_name", TType.STRING, (short)2); + private static final TField PART_VALS_FIELD_DESC = new TField("part_vals", TType.LIST, (short)3); - private Database database; - public static final int DATABASE = 1; + private String db_name; + public static final int DB_NAME = 1; + private String tbl_name; + public static final int TBL_NAME = 2; + private List part_vals; + public static final int PART_VALS = 3; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { } public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ - put(DATABASE, new FieldMetaData("database", TFieldRequirementType.DEFAULT, - new StructMetaData(TType.STRUCT, Database.class))); + put(DB_NAME, new FieldMetaData("db_name", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + put(TBL_NAME, new FieldMetaData("tbl_name", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + put(PART_VALS, new FieldMetaData("part_vals", TFieldRequirementType.DEFAULT, + new ListMetaData(TType.LIST, + new FieldValueMetaData(TType.STRING)))); }}); static { - FieldMetaData.addStructMetaDataMap(create_database_args.class, metaDataMap); + FieldMetaData.addStructMetaDataMap(append_partition_args.class, metaDataMap); } - public create_database_args() { + public append_partition_args() { } - public create_database_args( - Database database) + public append_partition_args( + String db_name, + String tbl_name, + List part_vals) { this(); - this.database = database; + this.db_name = db_name; + this.tbl_name = tbl_name; + this.part_vals = part_vals; } /** * Performs a deep copy on other. */ - public create_database_args(create_database_args other) { - if (other.isSetDatabase()) { - this.database = new Database(other.database); + public append_partition_args(append_partition_args other) { + if (other.isSetDb_name()) { + this.db_name = other.db_name; + } + if (other.isSetTbl_name()) { + this.tbl_name = other.tbl_name; + } + if (other.isSetPart_vals()) { + List __this__part_vals = new ArrayList(); + for (String other_element : other.part_vals) { + __this__part_vals.add(other_element); + } + this.part_vals = __this__part_vals; } } @Override - public create_database_args clone() { - return new create_database_args(this); + public append_partition_args clone() { + return new append_partition_args(this); } - public Database getDatabase() { - return this.database; + public String getDb_name() { + return this.db_name; } - public void setDatabase(Database database) { - this.database = database; + public void setDb_name(String db_name) { + this.db_name = db_name; } - public void unsetDatabase() { - this.database = null; + public void unsetDb_name() { + this.db_name = null; + } + + // Returns true if field db_name is set (has been asigned a value) and false otherwise + public boolean isSetDb_name() { + return this.db_name != null; + } + + public String getTbl_name() { + return this.tbl_name; + } + + public void setTbl_name(String tbl_name) { + this.tbl_name = tbl_name; + } + + public void unsetTbl_name() { + this.tbl_name = null; + } + + // Returns true if field tbl_name is set (has been asigned a value) and false otherwise + public boolean isSetTbl_name() { + return this.tbl_name != null; + } + + public int getPart_valsSize() { + return (this.part_vals == null) ? 0 : this.part_vals.size(); + } + + public java.util.Iterator getPart_valsIterator() { + return (this.part_vals == null) ? null : this.part_vals.iterator(); + } + + public void addToPart_vals(String elem) { + if (this.part_vals == null) { + this.part_vals = new ArrayList(); + } + this.part_vals.add(elem); + } + + public List getPart_vals() { + return this.part_vals; + } + + public void setPart_vals(List part_vals) { + this.part_vals = part_vals; + } + + public void unsetPart_vals() { + this.part_vals = null; } - // Returns true if field database is set (has been asigned a value) and false otherwise - public boolean isSetDatabase() { - return this.database != null; + // Returns true if field part_vals is set (has been asigned a value) and false otherwise + public boolean isSetPart_vals() { + return this.part_vals != null; } public void setFieldValue(int fieldID, Object value) { switch (fieldID) { - case DATABASE: + case DB_NAME: if (value == null) { - unsetDatabase(); + unsetDb_name(); } else { - setDatabase((Database)value); + setDb_name((String)value); + } + break; + + case TBL_NAME: + if (value == null) { + unsetTbl_name(); + } else { + setTbl_name((String)value); + } + break; + + case PART_VALS: + if (value == null) { + unsetPart_vals(); + } else { + setPart_vals((List)value); } break; @@ -2913,8 +14220,14 @@ public Object getFieldValue(int fieldID) { switch (fieldID) { - case DATABASE: - return getDatabase(); + case DB_NAME: + return getDb_name(); + + case TBL_NAME: + return getTbl_name(); + + case PART_VALS: + return getPart_vals(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); @@ -2924,8 +14237,12 @@ // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise public boolean isSet(int fieldID) { switch (fieldID) { - case DATABASE: - return isSetDatabase(); + case DB_NAME: + return isSetDb_name(); + case TBL_NAME: + return isSetTbl_name(); + case PART_VALS: + return isSetPart_vals(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -2935,21 +14252,39 @@ public boolean equals(Object that) { if (that == null) return false; - if (that instanceof create_database_args) - return this.equals((create_database_args)that); + if (that instanceof append_partition_args) + return this.equals((append_partition_args)that); return false; } - public boolean equals(create_database_args that) { + public boolean equals(append_partition_args that) { if (that == null) return false; - boolean this_present_database = true && this.isSetDatabase(); - boolean that_present_database = true && that.isSetDatabase(); - if (this_present_database || that_present_database) { - if (!(this_present_database && that_present_database)) + 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) { + if (!(this_present_db_name && that_present_db_name)) return false; - if (!this.database.equals(that.database)) + if (!this.db_name.equals(that.db_name)) + return false; + } + + boolean this_present_tbl_name = true && this.isSetTbl_name(); + boolean that_present_tbl_name = true && that.isSetTbl_name(); + if (this_present_tbl_name || that_present_tbl_name) { + if (!(this_present_tbl_name && that_present_tbl_name)) + return false; + if (!this.tbl_name.equals(that.tbl_name)) + return false; + } + + boolean this_present_part_vals = true && this.isSetPart_vals(); + boolean that_present_part_vals = true && that.isSetPart_vals(); + if (this_present_part_vals || that_present_part_vals) { + if (!(this_present_part_vals && that_present_part_vals)) + return false; + if (!this.part_vals.equals(that.part_vals)) return false; } @@ -2972,10 +14307,33 @@ } switch (field.id) { - case DATABASE: - if (field.type == TType.STRUCT) { - this.database = new Database(); - this.database.read(iprot); + case DB_NAME: + if (field.type == TType.STRING) { + this.db_name = iprot.readString(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case TBL_NAME: + if (field.type == TType.STRING) { + this.tbl_name = iprot.readString(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case PART_VALS: + if (field.type == TType.LIST) { + { + TList _list126 = iprot.readListBegin(); + this.part_vals = new ArrayList(_list126.size); + for (int _i127 = 0; _i127 < _list126.size; ++_i127) + { + String _elem128; + _elem128 = iprot.readString(); + this.part_vals.add(_elem128); + } + iprot.readListEnd(); + } } else { TProtocolUtil.skip(iprot, field.type); } @@ -2995,9 +14353,25 @@ validate(); oprot.writeStructBegin(STRUCT_DESC); - if (this.database != null) { - oprot.writeFieldBegin(DATABASE_FIELD_DESC); - this.database.write(oprot); + if (this.db_name != null) { + oprot.writeFieldBegin(DB_NAME_FIELD_DESC); + oprot.writeString(this.db_name); + oprot.writeFieldEnd(); + } + if (this.tbl_name != null) { + oprot.writeFieldBegin(TBL_NAME_FIELD_DESC); + oprot.writeString(this.tbl_name); + oprot.writeFieldEnd(); + } + if (this.part_vals != null) { + oprot.writeFieldBegin(PART_VALS_FIELD_DESC); + { + oprot.writeListBegin(new TList(TType.STRING, this.part_vals.size())); + for (String _iter129 : this.part_vals) { + oprot.writeString(_iter129); + } + oprot.writeListEnd(); + } oprot.writeFieldEnd(); } oprot.writeFieldStop(); @@ -3006,14 +14380,30 @@ @Override public String toString() { - StringBuilder sb = new StringBuilder("create_database_args("); + StringBuilder sb = new StringBuilder("append_partition_args("); boolean first = true; - sb.append("database:"); - if (this.database == null) { + sb.append("db_name:"); + if (this.db_name == null) { sb.append("null"); } else { - sb.append(this.database); + sb.append(this.db_name); + } + first = false; + if (!first) sb.append(", "); + sb.append("tbl_name:"); + if (this.tbl_name == null) { + sb.append("null"); + } else { + sb.append(this.tbl_name); + } + first = false; + if (!first) sb.append(", "); + sb.append("part_vals:"); + if (this.part_vals == null) { + sb.append("null"); + } else { + sb.append(this.part_vals); } first = false; sb.append(")"); @@ -3027,15 +14417,18 @@ } - public static class create_database_result implements TBase, java.io.Serializable, Cloneable { - private static final TStruct STRUCT_DESC = new TStruct("create_database_result"); + public static class append_partition_result implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("append_partition_result"); + private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.STRUCT, (short)0); private static final TField O1_FIELD_DESC = new TField("o1", TType.STRUCT, (short)1); private static final TField O2_FIELD_DESC = new TField("o2", TType.STRUCT, (short)2); private static final TField O3_FIELD_DESC = new TField("o3", TType.STRUCT, (short)3); - private AlreadyExistsException o1; + private Partition success; + public static final int SUCCESS = 0; + private InvalidObjectException o1; public static final int O1 = 1; - private InvalidObjectException o2; + private AlreadyExistsException o2; public static final int O2 = 2; private MetaException o3; public static final int O3 = 3; @@ -3045,6 +14438,8 @@ } public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ + put(SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, + new StructMetaData(TType.STRUCT, Partition.class))); put(O1, new FieldMetaData("o1", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRUCT))); put(O2, new FieldMetaData("o2", TFieldRequirementType.DEFAULT, @@ -3054,18 +14449,20 @@ }}); static { - FieldMetaData.addStructMetaDataMap(create_database_result.class, metaDataMap); + FieldMetaData.addStructMetaDataMap(append_partition_result.class, metaDataMap); } - public create_database_result() { + public append_partition_result() { } - public create_database_result( - AlreadyExistsException o1, - InvalidObjectException o2, + public append_partition_result( + Partition success, + InvalidObjectException o1, + AlreadyExistsException o2, MetaException o3) { this(); + this.success = success; this.o1 = o1; this.o2 = o2; this.o3 = o3; @@ -3074,12 +14471,15 @@ /** * Performs a deep copy on other. */ - public create_database_result(create_database_result other) { + public append_partition_result(append_partition_result other) { + if (other.isSetSuccess()) { + this.success = new Partition(other.success); + } if (other.isSetO1()) { - this.o1 = new AlreadyExistsException(other.o1); + this.o1 = new InvalidObjectException(other.o1); } if (other.isSetO2()) { - this.o2 = new InvalidObjectException(other.o2); + this.o2 = new AlreadyExistsException(other.o2); } if (other.isSetO3()) { this.o3 = new MetaException(other.o3); @@ -3087,15 +14487,32 @@ } @Override - public create_database_result clone() { - return new create_database_result(this); + public append_partition_result clone() { + return new append_partition_result(this); } - public AlreadyExistsException getO1() { + public Partition getSuccess() { + return this.success; + } + + public void setSuccess(Partition success) { + this.success = success; + } + + public void unsetSuccess() { + this.success = null; + } + + // Returns true if field success is set (has been asigned a value) and false otherwise + public boolean isSetSuccess() { + return this.success != null; + } + + public InvalidObjectException getO1() { return this.o1; } - public void setO1(AlreadyExistsException o1) { + public void setO1(InvalidObjectException o1) { this.o1 = o1; } @@ -3108,11 +14525,11 @@ return this.o1 != null; } - public InvalidObjectException getO2() { + public AlreadyExistsException getO2() { return this.o2; } - public void setO2(InvalidObjectException o2) { + public void setO2(AlreadyExistsException o2) { this.o2 = o2; } @@ -3144,11 +14561,19 @@ public void setFieldValue(int fieldID, Object value) { switch (fieldID) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((Partition)value); + } + break; + case O1: if (value == null) { unsetO1(); } else { - setO1((AlreadyExistsException)value); + setO1((InvalidObjectException)value); } break; @@ -3156,7 +14581,7 @@ if (value == null) { unsetO2(); } else { - setO2((InvalidObjectException)value); + setO2((AlreadyExistsException)value); } break; @@ -3175,6 +14600,9 @@ public Object getFieldValue(int fieldID) { switch (fieldID) { + case SUCCESS: + return getSuccess(); + case O1: return getO1(); @@ -3192,6 +14620,8 @@ // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise public boolean isSet(int fieldID) { switch (fieldID) { + case SUCCESS: + return isSetSuccess(); case O1: return isSetO1(); case O2: @@ -3207,15 +14637,24 @@ public boolean equals(Object that) { if (that == null) return false; - if (that instanceof create_database_result) - return this.equals((create_database_result)that); + if (that instanceof append_partition_result) + return this.equals((append_partition_result)that); return false; } - public boolean equals(create_database_result that) { + public boolean equals(append_partition_result that) { if (that == null) return false; + boolean this_present_success = true && this.isSetSuccess(); + boolean that_present_success = true && that.isSetSuccess(); + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (!this.success.equals(that.success)) + return false; + } + boolean this_present_o1 = true && this.isSetO1(); boolean that_present_o1 = true && that.isSetO1(); if (this_present_o1 || that_present_o1) { @@ -3262,9 +14701,17 @@ } switch (field.id) { + case SUCCESS: + if (field.type == TType.STRUCT) { + this.success = new Partition(); + this.success.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; case O1: if (field.type == TType.STRUCT) { - this.o1 = new AlreadyExistsException(); + this.o1 = new InvalidObjectException(); this.o1.read(iprot); } else { TProtocolUtil.skip(iprot, field.type); @@ -3272,7 +14719,7 @@ break; case O2: if (field.type == TType.STRUCT) { - this.o2 = new InvalidObjectException(); + this.o2 = new AlreadyExistsException(); this.o2.read(iprot); } else { TProtocolUtil.skip(iprot, field.type); @@ -3300,7 +14747,11 @@ public void write(TProtocol oprot) throws TException { oprot.writeStructBegin(STRUCT_DESC); - if (this.isSetO1()) { + if (this.isSetSuccess()) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + this.success.write(oprot); + oprot.writeFieldEnd(); + } else if (this.isSetO1()) { oprot.writeFieldBegin(O1_FIELD_DESC); this.o1.write(oprot); oprot.writeFieldEnd(); @@ -3319,9 +14770,17 @@ @Override public String toString() { - StringBuilder sb = new StringBuilder("create_database_result("); + StringBuilder sb = new StringBuilder("append_partition_result("); boolean first = true; + sb.append("success:"); + if (this.success == null) { + sb.append("null"); + } else { + sb.append(this.success); + } + first = false; + if (!first) sb.append(", "); sb.append("o1:"); if (this.o1 == null) { sb.append("null"); @@ -3356,74 +14815,144 @@ } - public static class get_database_args implements TBase, java.io.Serializable, Cloneable { - private static final TStruct STRUCT_DESC = new TStruct("get_database_args"); - private static final TField NAME_FIELD_DESC = new TField("name", TType.STRING, (short)1); + public static class append_partition_by_name_args implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("append_partition_by_name_args"); + private static final TField DB_NAME_FIELD_DESC = new TField("db_name", TType.STRING, (short)1); + private static final TField TBL_NAME_FIELD_DESC = new TField("tbl_name", TType.STRING, (short)2); + private static final TField PART_NAME_FIELD_DESC = new TField("part_name", TType.STRING, (short)3); - private String name; - public static final int NAME = 1; + private String db_name; + public static final int DB_NAME = 1; + private String tbl_name; + public static final int TBL_NAME = 2; + private String part_name; + public static final int PART_NAME = 3; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { } public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ - put(NAME, new FieldMetaData("name", TFieldRequirementType.DEFAULT, + put(DB_NAME, new FieldMetaData("db_name", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + put(TBL_NAME, new FieldMetaData("tbl_name", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + put(PART_NAME, new FieldMetaData("part_name", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRING))); }}); static { - FieldMetaData.addStructMetaDataMap(get_database_args.class, metaDataMap); + FieldMetaData.addStructMetaDataMap(append_partition_by_name_args.class, metaDataMap); } - public get_database_args() { + public append_partition_by_name_args() { } - public get_database_args( - String name) + public append_partition_by_name_args( + String db_name, + String tbl_name, + String part_name) { this(); - this.name = name; + this.db_name = db_name; + this.tbl_name = tbl_name; + this.part_name = part_name; } /** * Performs a deep copy on other. */ - public get_database_args(get_database_args other) { - if (other.isSetName()) { - this.name = other.name; + public append_partition_by_name_args(append_partition_by_name_args other) { + if (other.isSetDb_name()) { + this.db_name = other.db_name; + } + if (other.isSetTbl_name()) { + this.tbl_name = other.tbl_name; + } + if (other.isSetPart_name()) { + this.part_name = other.part_name; } } @Override - public get_database_args clone() { - return new get_database_args(this); + public append_partition_by_name_args clone() { + return new append_partition_by_name_args(this); } - public String getName() { - return this.name; + public String getDb_name() { + return this.db_name; } - public void setName(String name) { - this.name = name; + public void setDb_name(String db_name) { + this.db_name = db_name; } - public void unsetName() { - this.name = null; + public void unsetDb_name() { + this.db_name = null; } - // Returns true if field name is set (has been asigned a value) and false otherwise - public boolean isSetName() { - return this.name != null; + // Returns true if field db_name is set (has been asigned a value) and false otherwise + public boolean isSetDb_name() { + return this.db_name != null; + } + + public String getTbl_name() { + return this.tbl_name; + } + + public void setTbl_name(String tbl_name) { + this.tbl_name = tbl_name; + } + + public void unsetTbl_name() { + this.tbl_name = null; + } + + // Returns true if field tbl_name is set (has been asigned a value) and false otherwise + public boolean isSetTbl_name() { + return this.tbl_name != null; + } + + public String getPart_name() { + return this.part_name; + } + + public void setPart_name(String part_name) { + this.part_name = part_name; + } + + public void unsetPart_name() { + this.part_name = null; + } + + // Returns true if field part_name is set (has been asigned a value) and false otherwise + public boolean isSetPart_name() { + return this.part_name != null; } public void setFieldValue(int fieldID, Object value) { switch (fieldID) { - case NAME: + case DB_NAME: if (value == null) { - unsetName(); + unsetDb_name(); } else { - setName((String)value); + setDb_name((String)value); + } + break; + + case TBL_NAME: + if (value == null) { + unsetTbl_name(); + } else { + setTbl_name((String)value); + } + break; + + case PART_NAME: + if (value == null) { + unsetPart_name(); + } else { + setPart_name((String)value); } break; @@ -3434,8 +14963,14 @@ public Object getFieldValue(int fieldID) { switch (fieldID) { - case NAME: - return getName(); + case DB_NAME: + return getDb_name(); + + case TBL_NAME: + return getTbl_name(); + + case PART_NAME: + return getPart_name(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); @@ -3445,8 +14980,12 @@ // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise public boolean isSet(int fieldID) { switch (fieldID) { - case NAME: - return isSetName(); + case DB_NAME: + return isSetDb_name(); + case TBL_NAME: + return isSetTbl_name(); + case PART_NAME: + return isSetPart_name(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -3456,21 +14995,39 @@ public boolean equals(Object that) { if (that == null) return false; - if (that instanceof get_database_args) - return this.equals((get_database_args)that); + if (that instanceof append_partition_by_name_args) + return this.equals((append_partition_by_name_args)that); return false; } - public boolean equals(get_database_args that) { + public boolean equals(append_partition_by_name_args 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)) + 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) { + if (!(this_present_db_name && that_present_db_name)) return false; - if (!this.name.equals(that.name)) + if (!this.db_name.equals(that.db_name)) + return false; + } + + boolean this_present_tbl_name = true && this.isSetTbl_name(); + boolean that_present_tbl_name = true && that.isSetTbl_name(); + if (this_present_tbl_name || that_present_tbl_name) { + if (!(this_present_tbl_name && that_present_tbl_name)) + return false; + if (!this.tbl_name.equals(that.tbl_name)) + return false; + } + + boolean this_present_part_name = true && this.isSetPart_name(); + boolean that_present_part_name = true && that.isSetPart_name(); + if (this_present_part_name || that_present_part_name) { + if (!(this_present_part_name && that_present_part_name)) + return false; + if (!this.part_name.equals(that.part_name)) return false; } @@ -3493,9 +15050,23 @@ } switch (field.id) { - case NAME: + case DB_NAME: if (field.type == TType.STRING) { - this.name = iprot.readString(); + this.db_name = iprot.readString(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case TBL_NAME: + if (field.type == TType.STRING) { + this.tbl_name = iprot.readString(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case PART_NAME: + if (field.type == TType.STRING) { + this.part_name = iprot.readString(); } else { TProtocolUtil.skip(iprot, field.type); } @@ -3515,9 +15086,19 @@ validate(); oprot.writeStructBegin(STRUCT_DESC); - if (this.name != null) { - oprot.writeFieldBegin(NAME_FIELD_DESC); - oprot.writeString(this.name); + if (this.db_name != null) { + oprot.writeFieldBegin(DB_NAME_FIELD_DESC); + oprot.writeString(this.db_name); + oprot.writeFieldEnd(); + } + if (this.tbl_name != null) { + oprot.writeFieldBegin(TBL_NAME_FIELD_DESC); + oprot.writeString(this.tbl_name); + oprot.writeFieldEnd(); + } + if (this.part_name != null) { + oprot.writeFieldBegin(PART_NAME_FIELD_DESC); + oprot.writeString(this.part_name); oprot.writeFieldEnd(); } oprot.writeFieldStop(); @@ -3526,14 +15107,30 @@ @Override public String toString() { - StringBuilder sb = new StringBuilder("get_database_args("); + StringBuilder sb = new StringBuilder("append_partition_by_name_args("); boolean first = true; - sb.append("name:"); - if (this.name == null) { + sb.append("db_name:"); + if (this.db_name == null) { + sb.append("null"); + } else { + sb.append(this.db_name); + } + first = false; + if (!first) sb.append(", "); + sb.append("tbl_name:"); + if (this.tbl_name == null) { + sb.append("null"); + } else { + sb.append(this.tbl_name); + } + first = false; + if (!first) sb.append(", "); + sb.append("part_name:"); + if (this.part_name == null) { sb.append("null"); } else { - sb.append(this.name); + sb.append(this.part_name); } first = false; sb.append(")"); @@ -3547,18 +15144,21 @@ } - public static class get_database_result implements TBase, java.io.Serializable, Cloneable { - private static final TStruct STRUCT_DESC = new TStruct("get_database_result"); + public static class append_partition_by_name_result implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("append_partition_by_name_result"); private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.STRUCT, (short)0); private static final TField O1_FIELD_DESC = new TField("o1", TType.STRUCT, (short)1); private static final TField O2_FIELD_DESC = new TField("o2", TType.STRUCT, (short)2); + private static final TField O3_FIELD_DESC = new TField("o3", TType.STRUCT, (short)3); - private Database success; + private Partition success; public static final int SUCCESS = 0; - private NoSuchObjectException o1; + private InvalidObjectException o1; public static final int O1 = 1; - private MetaException o2; + private AlreadyExistsException o2; public static final int O2 = 2; + private MetaException o3; + public static final int O3 = 3; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { @@ -3566,56 +15166,63 @@ public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ put(SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, - new StructMetaData(TType.STRUCT, Database.class))); + new StructMetaData(TType.STRUCT, Partition.class))); put(O1, new FieldMetaData("o1", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRUCT))); put(O2, new FieldMetaData("o2", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRUCT))); + put(O3, new FieldMetaData("o3", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRUCT))); }}); static { - FieldMetaData.addStructMetaDataMap(get_database_result.class, metaDataMap); + FieldMetaData.addStructMetaDataMap(append_partition_by_name_result.class, metaDataMap); } - public get_database_result() { + public append_partition_by_name_result() { } - public get_database_result( - Database success, - NoSuchObjectException o1, - MetaException o2) + public append_partition_by_name_result( + Partition success, + InvalidObjectException o1, + AlreadyExistsException o2, + MetaException o3) { this(); this.success = success; this.o1 = o1; this.o2 = o2; + this.o3 = o3; } /** * Performs a deep copy on other. */ - public get_database_result(get_database_result other) { + public append_partition_by_name_result(append_partition_by_name_result other) { if (other.isSetSuccess()) { - this.success = new Database(other.success); + this.success = new Partition(other.success); } if (other.isSetO1()) { - this.o1 = new NoSuchObjectException(other.o1); + this.o1 = new InvalidObjectException(other.o1); } if (other.isSetO2()) { - this.o2 = new MetaException(other.o2); + this.o2 = new AlreadyExistsException(other.o2); + } + if (other.isSetO3()) { + this.o3 = new MetaException(other.o3); } } @Override - public get_database_result clone() { - return new get_database_result(this); + public append_partition_by_name_result clone() { + return new append_partition_by_name_result(this); } - public Database getSuccess() { + public Partition getSuccess() { return this.success; } - public void setSuccess(Database success) { + public void setSuccess(Partition success) { this.success = success; } @@ -3628,11 +15235,11 @@ return this.success != null; } - public NoSuchObjectException getO1() { + public InvalidObjectException getO1() { return this.o1; } - public void setO1(NoSuchObjectException o1) { + public void setO1(InvalidObjectException o1) { this.o1 = o1; } @@ -3645,11 +15252,11 @@ return this.o1 != null; } - public MetaException getO2() { + public AlreadyExistsException getO2() { return this.o2; } - public void setO2(MetaException o2) { + public void setO2(AlreadyExistsException o2) { this.o2 = o2; } @@ -3662,13 +15269,30 @@ return this.o2 != null; } + public MetaException getO3() { + return this.o3; + } + + public void setO3(MetaException o3) { + this.o3 = o3; + } + + public void unsetO3() { + this.o3 = null; + } + + // Returns true if field o3 is set (has been asigned a value) and false otherwise + public boolean isSetO3() { + return this.o3 != null; + } + public void setFieldValue(int fieldID, Object value) { switch (fieldID) { case SUCCESS: if (value == null) { unsetSuccess(); } else { - setSuccess((Database)value); + setSuccess((Partition)value); } break; @@ -3676,7 +15300,7 @@ if (value == null) { unsetO1(); } else { - setO1((NoSuchObjectException)value); + setO1((InvalidObjectException)value); } break; @@ -3684,7 +15308,15 @@ if (value == null) { unsetO2(); } else { - setO2((MetaException)value); + setO2((AlreadyExistsException)value); + } + break; + + case O3: + if (value == null) { + unsetO3(); + } else { + setO3((MetaException)value); } break; @@ -3704,6 +15336,9 @@ case O2: return getO2(); + case O3: + return getO3(); + default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -3718,6 +15353,8 @@ return isSetO1(); case O2: return isSetO2(); + case O3: + return isSetO3(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -3727,12 +15364,12 @@ public boolean equals(Object that) { if (that == null) return false; - if (that instanceof get_database_result) - return this.equals((get_database_result)that); + if (that instanceof append_partition_by_name_result) + return this.equals((append_partition_by_name_result)that); return false; } - public boolean equals(get_database_result that) { + public boolean equals(append_partition_by_name_result that) { if (that == null) return false; @@ -3763,6 +15400,15 @@ return false; } + boolean this_present_o3 = true && this.isSetO3(); + boolean that_present_o3 = true && that.isSetO3(); + if (this_present_o3 || that_present_o3) { + if (!(this_present_o3 && that_present_o3)) + return false; + if (!this.o3.equals(that.o3)) + return false; + } + return true; } @@ -3784,7 +15430,7 @@ { case SUCCESS: if (field.type == TType.STRUCT) { - this.success = new Database(); + this.success = new Partition(); this.success.read(iprot); } else { TProtocolUtil.skip(iprot, field.type); @@ -3792,7 +15438,7 @@ break; case O1: if (field.type == TType.STRUCT) { - this.o1 = new NoSuchObjectException(); + this.o1 = new InvalidObjectException(); this.o1.read(iprot); } else { TProtocolUtil.skip(iprot, field.type); @@ -3800,12 +15446,20 @@ break; case O2: if (field.type == TType.STRUCT) { - this.o2 = new MetaException(); + this.o2 = new AlreadyExistsException(); this.o2.read(iprot); } else { TProtocolUtil.skip(iprot, field.type); } break; + case O3: + if (field.type == TType.STRUCT) { + this.o3 = new MetaException(); + this.o3.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; default: TProtocolUtil.skip(iprot, field.type); break; @@ -3832,6 +15486,10 @@ oprot.writeFieldBegin(O2_FIELD_DESC); this.o2.write(oprot); oprot.writeFieldEnd(); + } else if (this.isSetO3()) { + oprot.writeFieldBegin(O3_FIELD_DESC); + this.o3.write(oprot); + oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); @@ -3839,7 +15497,7 @@ @Override public String toString() { - StringBuilder sb = new StringBuilder("get_database_result("); + StringBuilder sb = new StringBuilder("append_partition_by_name_result("); boolean first = true; sb.append("success:"); @@ -3865,6 +15523,14 @@ sb.append(this.o2); } first = false; + if (!first) sb.append(", "); + sb.append("o3:"); + if (this.o3 == null) { + sb.append("null"); + } else { + sb.append(this.o3); + } + first = false; sb.append(")"); return sb.toString(); } @@ -3876,15 +15542,21 @@ } - public static class drop_database_args implements TBase, java.io.Serializable, Cloneable { - private static final TStruct STRUCT_DESC = new TStruct("drop_database_args"); - private static final TField NAME_FIELD_DESC = new TField("name", TType.STRING, (short)1); - private static final TField DELETE_DATA_FIELD_DESC = new TField("deleteData", TType.BOOL, (short)2); + public static class drop_partition_args implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("drop_partition_args"); + private static final TField DB_NAME_FIELD_DESC = new TField("db_name", TType.STRING, (short)1); + private static final TField TBL_NAME_FIELD_DESC = new TField("tbl_name", TType.STRING, (short)2); + private static final TField PART_VALS_FIELD_DESC = new TField("part_vals", TType.LIST, (short)3); + private static final TField DELETE_DATA_FIELD_DESC = new TField("deleteData", TType.BOOL, (short)4); - private String name; - public static final int NAME = 1; + private String db_name; + public static final int DB_NAME = 1; + private String tbl_name; + public static final int TBL_NAME = 2; + private List part_vals; + public static final int PART_VALS = 3; private boolean deleteData; - public static final int DELETEDATA = 2; + public static final int DELETEDATA = 4; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { @@ -3892,25 +15564,34 @@ } public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ - put(NAME, new FieldMetaData("name", TFieldRequirementType.DEFAULT, + put(DB_NAME, new FieldMetaData("db_name", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + put(TBL_NAME, new FieldMetaData("tbl_name", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRING))); + put(PART_VALS, new FieldMetaData("part_vals", TFieldRequirementType.DEFAULT, + new ListMetaData(TType.LIST, + new FieldValueMetaData(TType.STRING)))); put(DELETEDATA, new FieldMetaData("deleteData", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.BOOL))); }}); static { - FieldMetaData.addStructMetaDataMap(drop_database_args.class, metaDataMap); + FieldMetaData.addStructMetaDataMap(drop_partition_args.class, metaDataMap); } - public drop_database_args() { + public drop_partition_args() { } - public drop_database_args( - String name, + public drop_partition_args( + String db_name, + String tbl_name, + List part_vals, boolean deleteData) { this(); - this.name = name; + this.db_name = db_name; + this.tbl_name = tbl_name; + this.part_vals = part_vals; this.deleteData = deleteData; this.__isset.deleteData = true; } @@ -3918,34 +15599,93 @@ /** * Performs a deep copy on other. */ - public drop_database_args(drop_database_args other) { - if (other.isSetName()) { - this.name = other.name; + public drop_partition_args(drop_partition_args other) { + if (other.isSetDb_name()) { + this.db_name = other.db_name; + } + if (other.isSetTbl_name()) { + this.tbl_name = other.tbl_name; + } + if (other.isSetPart_vals()) { + List __this__part_vals = new ArrayList(); + for (String other_element : other.part_vals) { + __this__part_vals.add(other_element); + } + this.part_vals = __this__part_vals; } __isset.deleteData = other.__isset.deleteData; this.deleteData = other.deleteData; } @Override - public drop_database_args clone() { - return new drop_database_args(this); + public drop_partition_args clone() { + return new drop_partition_args(this); } - public String getName() { - return this.name; + public String getDb_name() { + return this.db_name; + } + + public void setDb_name(String db_name) { + this.db_name = db_name; + } + + public void unsetDb_name() { + this.db_name = null; + } + + // Returns true if field db_name is set (has been asigned a value) and false otherwise + public boolean isSetDb_name() { + return this.db_name != null; + } + + public String getTbl_name() { + return this.tbl_name; + } + + public void setTbl_name(String tbl_name) { + this.tbl_name = tbl_name; + } + + public void unsetTbl_name() { + this.tbl_name = null; + } + + // Returns true if field tbl_name is set (has been asigned a value) and false otherwise + public boolean isSetTbl_name() { + return this.tbl_name != null; + } + + public int getPart_valsSize() { + return (this.part_vals == null) ? 0 : this.part_vals.size(); + } + + public java.util.Iterator getPart_valsIterator() { + return (this.part_vals == null) ? null : this.part_vals.iterator(); + } + + public void addToPart_vals(String elem) { + if (this.part_vals == null) { + this.part_vals = new ArrayList(); + } + this.part_vals.add(elem); + } + + public List getPart_vals() { + return this.part_vals; } - public void setName(String name) { - this.name = name; + public void setPart_vals(List part_vals) { + this.part_vals = part_vals; } - public void unsetName() { - this.name = null; + public void unsetPart_vals() { + this.part_vals = null; } - // Returns true if field name is set (has been asigned a value) and false otherwise - public boolean isSetName() { - return this.name != null; + // Returns true if field part_vals is set (has been asigned a value) and false otherwise + public boolean isSetPart_vals() { + return this.part_vals != null; } public boolean isDeleteData() { @@ -3968,11 +15708,27 @@ public void setFieldValue(int fieldID, Object value) { switch (fieldID) { - case NAME: + case DB_NAME: if (value == null) { - unsetName(); + unsetDb_name(); } else { - setName((String)value); + setDb_name((String)value); + } + break; + + case TBL_NAME: + if (value == null) { + unsetTbl_name(); + } else { + setTbl_name((String)value); + } + break; + + case PART_VALS: + if (value == null) { + unsetPart_vals(); + } else { + setPart_vals((List)value); } break; @@ -3991,8 +15747,14 @@ public Object getFieldValue(int fieldID) { switch (fieldID) { - case NAME: - return getName(); + case DB_NAME: + return getDb_name(); + + case TBL_NAME: + return getTbl_name(); + + case PART_VALS: + return getPart_vals(); case DELETEDATA: return new Boolean(isDeleteData()); @@ -4005,8 +15767,12 @@ // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise public boolean isSet(int fieldID) { switch (fieldID) { - case NAME: - return isSetName(); + case DB_NAME: + return isSetDb_name(); + case TBL_NAME: + return isSetTbl_name(); + case PART_VALS: + return isSetPart_vals(); case DELETEDATA: return isSetDeleteData(); default: @@ -4018,21 +15784,39 @@ public boolean equals(Object that) { if (that == null) return false; - if (that instanceof drop_database_args) - return this.equals((drop_database_args)that); + if (that instanceof drop_partition_args) + return this.equals((drop_partition_args)that); return false; } - public boolean equals(drop_database_args that) { + public boolean equals(drop_partition_args 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)) + 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) { + if (!(this_present_db_name && that_present_db_name)) return false; - if (!this.name.equals(that.name)) + if (!this.db_name.equals(that.db_name)) + return false; + } + + boolean this_present_tbl_name = true && this.isSetTbl_name(); + boolean that_present_tbl_name = true && that.isSetTbl_name(); + if (this_present_tbl_name || that_present_tbl_name) { + if (!(this_present_tbl_name && that_present_tbl_name)) + return false; + if (!this.tbl_name.equals(that.tbl_name)) + return false; + } + + boolean this_present_part_vals = true && this.isSetPart_vals(); + boolean that_present_part_vals = true && that.isSetPart_vals(); + if (this_present_part_vals || that_present_part_vals) { + if (!(this_present_part_vals && that_present_part_vals)) + return false; + if (!this.part_vals.equals(that.part_vals)) return false; } @@ -4064,9 +15848,33 @@ } switch (field.id) { - case NAME: + case DB_NAME: if (field.type == TType.STRING) { - this.name = iprot.readString(); + this.db_name = iprot.readString(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case TBL_NAME: + if (field.type == TType.STRING) { + this.tbl_name = iprot.readString(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case PART_VALS: + if (field.type == TType.LIST) { + { + TList _list130 = iprot.readListBegin(); + this.part_vals = new ArrayList(_list130.size); + for (int _i131 = 0; _i131 < _list130.size; ++_i131) + { + String _elem132; + _elem132 = iprot.readString(); + this.part_vals.add(_elem132); + } + iprot.readListEnd(); + } } else { TProtocolUtil.skip(iprot, field.type); } @@ -4094,9 +15902,25 @@ validate(); oprot.writeStructBegin(STRUCT_DESC); - if (this.name != null) { - oprot.writeFieldBegin(NAME_FIELD_DESC); - oprot.writeString(this.name); + if (this.db_name != null) { + oprot.writeFieldBegin(DB_NAME_FIELD_DESC); + oprot.writeString(this.db_name); + oprot.writeFieldEnd(); + } + if (this.tbl_name != null) { + oprot.writeFieldBegin(TBL_NAME_FIELD_DESC); + oprot.writeString(this.tbl_name); + oprot.writeFieldEnd(); + } + if (this.part_vals != null) { + oprot.writeFieldBegin(PART_VALS_FIELD_DESC); + { + oprot.writeListBegin(new TList(TType.STRING, this.part_vals.size())); + for (String _iter133 : this.part_vals) { + oprot.writeString(_iter133); + } + oprot.writeListEnd(); + } oprot.writeFieldEnd(); } oprot.writeFieldBegin(DELETE_DATA_FIELD_DESC); @@ -4108,14 +15932,30 @@ @Override public String toString() { - StringBuilder sb = new StringBuilder("drop_database_args("); + StringBuilder sb = new StringBuilder("drop_partition_args("); boolean first = true; - sb.append("name:"); - if (this.name == null) { + sb.append("db_name:"); + if (this.db_name == null) { sb.append("null"); } else { - sb.append(this.name); + sb.append(this.db_name); + } + first = false; + if (!first) sb.append(", "); + sb.append("tbl_name:"); + if (this.tbl_name == null) { + sb.append("null"); + } else { + sb.append(this.tbl_name); + } + first = false; + if (!first) sb.append(", "); + sb.append("part_vals:"); + if (this.part_vals == null) { + sb.append("null"); + } else { + sb.append(this.part_vals); } first = false; if (!first) sb.append(", "); @@ -4133,68 +15973,87 @@ } - public static class drop_database_result implements TBase, java.io.Serializable, Cloneable { - private static final TStruct STRUCT_DESC = new TStruct("drop_database_result"); + public static class drop_partition_result implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("drop_partition_result"); + private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.BOOL, (short)0); private static final TField O1_FIELD_DESC = new TField("o1", TType.STRUCT, (short)1); private static final TField O2_FIELD_DESC = new TField("o2", TType.STRUCT, (short)2); - private static final TField O3_FIELD_DESC = new TField("o3", TType.STRUCT, (short)3); + private boolean success; + public static final int SUCCESS = 0; private NoSuchObjectException o1; public static final int O1 = 1; - private InvalidOperationException o2; + private MetaException o2; public static final int O2 = 2; - private MetaException o3; - public static final int O3 = 3; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { + public boolean success = false; } public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ + put(SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.BOOL))); put(O1, new FieldMetaData("o1", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRUCT))); put(O2, new FieldMetaData("o2", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRUCT))); - put(O3, new FieldMetaData("o3", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRUCT))); }}); static { - FieldMetaData.addStructMetaDataMap(drop_database_result.class, metaDataMap); + FieldMetaData.addStructMetaDataMap(drop_partition_result.class, metaDataMap); } - public drop_database_result() { + public drop_partition_result() { } - public drop_database_result( + public drop_partition_result( + boolean success, NoSuchObjectException o1, - InvalidOperationException o2, - MetaException o3) + MetaException o2) { this(); + this.success = success; + this.__isset.success = true; this.o1 = o1; this.o2 = o2; - this.o3 = o3; } /** * Performs a deep copy on other. */ - public drop_database_result(drop_database_result other) { + public drop_partition_result(drop_partition_result other) { + __isset.success = other.__isset.success; + this.success = other.success; if (other.isSetO1()) { this.o1 = new NoSuchObjectException(other.o1); } if (other.isSetO2()) { - this.o2 = new InvalidOperationException(other.o2); - } - if (other.isSetO3()) { - this.o3 = new MetaException(other.o3); + this.o2 = new MetaException(other.o2); } } @Override - public drop_database_result clone() { - return new drop_database_result(this); + public drop_partition_result clone() { + return new drop_partition_result(this); + } + + public boolean isSuccess() { + return this.success; + } + + public void setSuccess(boolean success) { + this.success = success; + this.__isset.success = true; + } + + public void unsetSuccess() { + this.__isset.success = false; + } + + // Returns true if field success is set (has been asigned a value) and false otherwise + public boolean isSetSuccess() { + return this.__isset.success; } public NoSuchObjectException getO1() { @@ -4214,11 +16073,11 @@ return this.o1 != null; } - public InvalidOperationException getO2() { + public MetaException getO2() { return this.o2; } - public void setO2(InvalidOperationException o2) { + public void setO2(MetaException o2) { this.o2 = o2; } @@ -4231,46 +16090,29 @@ return this.o2 != null; } - public MetaException getO3() { - return this.o3; - } - - public void setO3(MetaException o3) { - this.o3 = o3; - } - - public void unsetO3() { - this.o3 = null; - } - - // Returns true if field o3 is set (has been asigned a value) and false otherwise - public boolean isSetO3() { - return this.o3 != null; - } - public void setFieldValue(int fieldID, Object value) { switch (fieldID) { - case O1: + case SUCCESS: if (value == null) { - unsetO1(); + unsetSuccess(); } else { - setO1((NoSuchObjectException)value); + setSuccess((Boolean)value); } break; - case O2: + case O1: if (value == null) { - unsetO2(); + unsetO1(); } else { - setO2((InvalidOperationException)value); + setO1((NoSuchObjectException)value); } break; - case O3: + case O2: if (value == null) { - unsetO3(); + unsetO2(); } else { - setO3((MetaException)value); + setO2((MetaException)value); } break; @@ -4281,15 +16123,15 @@ public Object getFieldValue(int fieldID) { switch (fieldID) { + case SUCCESS: + return new Boolean(isSuccess()); + case O1: return getO1(); case O2: return getO2(); - case O3: - return getO3(); - default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -4298,12 +16140,12 @@ // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise public boolean isSet(int fieldID) { switch (fieldID) { + case SUCCESS: + return isSetSuccess(); case O1: return isSetO1(); case O2: return isSetO2(); - case O3: - return isSetO3(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -4313,15 +16155,24 @@ public boolean equals(Object that) { if (that == null) return false; - if (that instanceof drop_database_result) - return this.equals((drop_database_result)that); + if (that instanceof drop_partition_result) + return this.equals((drop_partition_result)that); return false; } - public boolean equals(drop_database_result that) { + public boolean equals(drop_partition_result that) { if (that == null) return false; + boolean this_present_success = true; + boolean that_present_success = true; + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (this.success != that.success) + return false; + } + boolean this_present_o1 = true && this.isSetO1(); boolean that_present_o1 = true && that.isSetO1(); if (this_present_o1 || that_present_o1) { @@ -4340,15 +16191,6 @@ return false; } - boolean this_present_o3 = true && this.isSetO3(); - boolean that_present_o3 = true && that.isSetO3(); - if (this_present_o3 || that_present_o3) { - if (!(this_present_o3 && that_present_o3)) - return false; - if (!this.o3.equals(that.o3)) - return false; - } - return true; } @@ -4368,6 +16210,14 @@ } switch (field.id) { + case SUCCESS: + if (field.type == TType.BOOL) { + this.success = iprot.readBool(); + this.__isset.success = true; + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; case O1: if (field.type == TType.STRUCT) { this.o1 = new NoSuchObjectException(); @@ -4378,20 +16228,12 @@ break; case O2: if (field.type == TType.STRUCT) { - this.o2 = new InvalidOperationException(); + this.o2 = new MetaException(); this.o2.read(iprot); } else { TProtocolUtil.skip(iprot, field.type); } break; - case O3: - if (field.type == TType.STRUCT) { - this.o3 = new MetaException(); - this.o3.read(iprot); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; default: TProtocolUtil.skip(iprot, field.type); break; @@ -4406,7 +16248,11 @@ public void write(TProtocol oprot) throws TException { oprot.writeStructBegin(STRUCT_DESC); - if (this.isSetO1()) { + if (this.isSetSuccess()) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + oprot.writeBool(this.success); + oprot.writeFieldEnd(); + } else if (this.isSetO1()) { oprot.writeFieldBegin(O1_FIELD_DESC); this.o1.write(oprot); oprot.writeFieldEnd(); @@ -4414,10 +16260,6 @@ oprot.writeFieldBegin(O2_FIELD_DESC); this.o2.write(oprot); oprot.writeFieldEnd(); - } else if (this.isSetO3()) { - oprot.writeFieldBegin(O3_FIELD_DESC); - this.o3.write(oprot); - oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); @@ -4425,9 +16267,13 @@ @Override public String toString() { - StringBuilder sb = new StringBuilder("drop_database_result("); + StringBuilder sb = new StringBuilder("drop_partition_result("); boolean first = true; + sb.append("success:"); + sb.append(this.success); + first = false; + if (!first) sb.append(", "); sb.append("o1:"); if (this.o1 == null) { sb.append("null"); @@ -4443,14 +16289,6 @@ sb.append(this.o2); } first = false; - if (!first) sb.append(", "); - sb.append("o3:"); - if (this.o3 == null) { - sb.append("null"); - } else { - sb.append(this.o3); - } - first = false; sb.append(")"); return sb.toString(); } @@ -4462,74 +16300,181 @@ } - public static class get_databases_args implements TBase, java.io.Serializable, Cloneable { - private static final TStruct STRUCT_DESC = new TStruct("get_databases_args"); - private static final TField PATTERN_FIELD_DESC = new TField("pattern", TType.STRING, (short)1); + public static class drop_partition_by_name_args implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("drop_partition_by_name_args"); + private static final TField DB_NAME_FIELD_DESC = new TField("db_name", TType.STRING, (short)1); + private static final TField TBL_NAME_FIELD_DESC = new TField("tbl_name", TType.STRING, (short)2); + private static final TField PART_NAME_FIELD_DESC = new TField("part_name", TType.STRING, (short)3); + private static final TField DELETE_DATA_FIELD_DESC = new TField("deleteData", TType.BOOL, (short)4); - private String pattern; - public static final int PATTERN = 1; + private String db_name; + public static final int DB_NAME = 1; + private String tbl_name; + public static final int TBL_NAME = 2; + private String part_name; + public static final int PART_NAME = 3; + private boolean deleteData; + public static final int DELETEDATA = 4; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { + public boolean deleteData = false; } public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ - put(PATTERN, new FieldMetaData("pattern", TFieldRequirementType.DEFAULT, + put(DB_NAME, new FieldMetaData("db_name", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + put(TBL_NAME, new FieldMetaData("tbl_name", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + put(PART_NAME, new FieldMetaData("part_name", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRING))); + put(DELETEDATA, new FieldMetaData("deleteData", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.BOOL))); }}); static { - FieldMetaData.addStructMetaDataMap(get_databases_args.class, metaDataMap); + FieldMetaData.addStructMetaDataMap(drop_partition_by_name_args.class, metaDataMap); } - public get_databases_args() { + public drop_partition_by_name_args() { } - public get_databases_args( - String pattern) + public drop_partition_by_name_args( + String db_name, + String tbl_name, + String part_name, + boolean deleteData) { this(); - this.pattern = pattern; + this.db_name = db_name; + this.tbl_name = tbl_name; + this.part_name = part_name; + this.deleteData = deleteData; + this.__isset.deleteData = true; } /** * Performs a deep copy on other. */ - public get_databases_args(get_databases_args other) { - if (other.isSetPattern()) { - this.pattern = other.pattern; + public drop_partition_by_name_args(drop_partition_by_name_args other) { + if (other.isSetDb_name()) { + this.db_name = other.db_name; + } + if (other.isSetTbl_name()) { + this.tbl_name = other.tbl_name; + } + if (other.isSetPart_name()) { + this.part_name = other.part_name; } + __isset.deleteData = other.__isset.deleteData; + this.deleteData = other.deleteData; } @Override - public get_databases_args clone() { - return new get_databases_args(this); + public drop_partition_by_name_args clone() { + return new drop_partition_by_name_args(this); } - public String getPattern() { - return this.pattern; + public String getDb_name() { + return this.db_name; } - public void setPattern(String pattern) { - this.pattern = pattern; + public void setDb_name(String db_name) { + this.db_name = db_name; } - public void unsetPattern() { - this.pattern = null; + public void unsetDb_name() { + this.db_name = null; } - // Returns true if field pattern is set (has been asigned a value) and false otherwise - public boolean isSetPattern() { - return this.pattern != null; + // Returns true if field db_name is set (has been asigned a value) and false otherwise + public boolean isSetDb_name() { + return this.db_name != null; + } + + public String getTbl_name() { + return this.tbl_name; + } + + public void setTbl_name(String tbl_name) { + this.tbl_name = tbl_name; + } + + public void unsetTbl_name() { + this.tbl_name = null; + } + + // Returns true if field tbl_name is set (has been asigned a value) and false otherwise + public boolean isSetTbl_name() { + return this.tbl_name != null; + } + + public String getPart_name() { + return this.part_name; + } + + public void setPart_name(String part_name) { + this.part_name = part_name; + } + + public void unsetPart_name() { + this.part_name = null; + } + + // Returns true if field part_name is set (has been asigned a value) and false otherwise + public boolean isSetPart_name() { + return this.part_name != null; + } + + public boolean isDeleteData() { + return this.deleteData; + } + + public void setDeleteData(boolean deleteData) { + this.deleteData = deleteData; + this.__isset.deleteData = true; + } + + public void unsetDeleteData() { + this.__isset.deleteData = false; + } + + // Returns true if field deleteData is set (has been asigned a value) and false otherwise + public boolean isSetDeleteData() { + return this.__isset.deleteData; } public void setFieldValue(int fieldID, Object value) { switch (fieldID) { - case PATTERN: + case DB_NAME: if (value == null) { - unsetPattern(); + unsetDb_name(); } else { - setPattern((String)value); + setDb_name((String)value); + } + break; + + case TBL_NAME: + if (value == null) { + unsetTbl_name(); + } else { + setTbl_name((String)value); + } + break; + + case PART_NAME: + if (value == null) { + unsetPart_name(); + } else { + setPart_name((String)value); + } + break; + + case DELETEDATA: + if (value == null) { + unsetDeleteData(); + } else { + setDeleteData((Boolean)value); } break; @@ -4540,8 +16485,17 @@ public Object getFieldValue(int fieldID) { switch (fieldID) { - case PATTERN: - return getPattern(); + case DB_NAME: + return getDb_name(); + + case TBL_NAME: + return getTbl_name(); + + case PART_NAME: + return getPart_name(); + + case DELETEDATA: + return new Boolean(isDeleteData()); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); @@ -4551,8 +16505,14 @@ // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise public boolean isSet(int fieldID) { switch (fieldID) { - case PATTERN: - return isSetPattern(); + case DB_NAME: + return isSetDb_name(); + case TBL_NAME: + return isSetTbl_name(); + case PART_NAME: + return isSetPart_name(); + case DELETEDATA: + return isSetDeleteData(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -4562,21 +16522,48 @@ public boolean equals(Object that) { if (that == null) return false; - if (that instanceof get_databases_args) - return this.equals((get_databases_args)that); + if (that instanceof drop_partition_by_name_args) + return this.equals((drop_partition_by_name_args)that); return false; } - public boolean equals(get_databases_args that) { + public boolean equals(drop_partition_by_name_args that) { if (that == null) return false; - boolean this_present_pattern = true && this.isSetPattern(); - boolean that_present_pattern = true && that.isSetPattern(); - if (this_present_pattern || that_present_pattern) { - if (!(this_present_pattern && that_present_pattern)) + 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) { + if (!(this_present_db_name && that_present_db_name)) return false; - if (!this.pattern.equals(that.pattern)) + if (!this.db_name.equals(that.db_name)) + return false; + } + + boolean this_present_tbl_name = true && this.isSetTbl_name(); + boolean that_present_tbl_name = true && that.isSetTbl_name(); + if (this_present_tbl_name || that_present_tbl_name) { + if (!(this_present_tbl_name && that_present_tbl_name)) + return false; + if (!this.tbl_name.equals(that.tbl_name)) + return false; + } + + boolean this_present_part_name = true && this.isSetPart_name(); + boolean that_present_part_name = true && that.isSetPart_name(); + if (this_present_part_name || that_present_part_name) { + if (!(this_present_part_name && that_present_part_name)) + return false; + if (!this.part_name.equals(that.part_name)) + return false; + } + + boolean this_present_deleteData = true; + boolean that_present_deleteData = true; + if (this_present_deleteData || that_present_deleteData) { + if (!(this_present_deleteData && that_present_deleteData)) + return false; + if (this.deleteData != that.deleteData) return false; } @@ -4599,9 +16586,31 @@ } switch (field.id) { - case PATTERN: + case DB_NAME: if (field.type == TType.STRING) { - this.pattern = iprot.readString(); + this.db_name = iprot.readString(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case TBL_NAME: + if (field.type == TType.STRING) { + this.tbl_name = iprot.readString(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case PART_NAME: + if (field.type == TType.STRING) { + this.part_name = iprot.readString(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case DELETEDATA: + if (field.type == TType.BOOL) { + this.deleteData = iprot.readBool(); + this.__isset.deleteData = true; } else { TProtocolUtil.skip(iprot, field.type); } @@ -4621,27 +16630,60 @@ validate(); oprot.writeStructBegin(STRUCT_DESC); - if (this.pattern != null) { - oprot.writeFieldBegin(PATTERN_FIELD_DESC); - oprot.writeString(this.pattern); + if (this.db_name != null) { + oprot.writeFieldBegin(DB_NAME_FIELD_DESC); + oprot.writeString(this.db_name); + oprot.writeFieldEnd(); + } + if (this.tbl_name != null) { + oprot.writeFieldBegin(TBL_NAME_FIELD_DESC); + oprot.writeString(this.tbl_name); + oprot.writeFieldEnd(); + } + if (this.part_name != null) { + oprot.writeFieldBegin(PART_NAME_FIELD_DESC); + oprot.writeString(this.part_name); oprot.writeFieldEnd(); } + oprot.writeFieldBegin(DELETE_DATA_FIELD_DESC); + oprot.writeBool(this.deleteData); + oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } @Override public String toString() { - StringBuilder sb = new StringBuilder("get_databases_args("); + StringBuilder sb = new StringBuilder("drop_partition_by_name_args("); boolean first = true; - sb.append("pattern:"); - if (this.pattern == null) { + sb.append("db_name:"); + if (this.db_name == null) { sb.append("null"); } else { - sb.append(this.pattern); + sb.append(this.db_name); + } + first = false; + if (!first) sb.append(", "); + sb.append("tbl_name:"); + if (this.tbl_name == null) { + sb.append("null"); + } else { + sb.append(this.tbl_name); + } + first = false; + if (!first) sb.append(", "); + sb.append("part_name:"); + if (this.part_name == null) { + sb.append("null"); + } else { + sb.append(this.part_name); } first = false; + if (!first) sb.append(", "); + sb.append("deleteData:"); + sb.append(this.deleteData); + first = false; sb.append(")"); return sb.toString(); } @@ -4653,102 +16695,94 @@ } - public static class get_databases_result implements TBase, java.io.Serializable, Cloneable { - private static final TStruct STRUCT_DESC = new TStruct("get_databases_result"); - private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.LIST, (short)0); + public static class drop_partition_by_name_result implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("drop_partition_by_name_result"); + private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.BOOL, (short)0); private static final TField O1_FIELD_DESC = new TField("o1", TType.STRUCT, (short)1); + private static final TField O2_FIELD_DESC = new TField("o2", TType.STRUCT, (short)2); - private List success; + private boolean success; public static final int SUCCESS = 0; - private MetaException o1; + private NoSuchObjectException o1; public static final int O1 = 1; + private MetaException o2; + public static final int O2 = 2; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { + public boolean success = false; } public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ put(SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, - new ListMetaData(TType.LIST, - new FieldValueMetaData(TType.STRING)))); + new FieldValueMetaData(TType.BOOL))); put(O1, new FieldMetaData("o1", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRUCT))); + put(O2, new FieldMetaData("o2", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRUCT))); }}); static { - FieldMetaData.addStructMetaDataMap(get_databases_result.class, metaDataMap); + FieldMetaData.addStructMetaDataMap(drop_partition_by_name_result.class, metaDataMap); } - public get_databases_result() { + public drop_partition_by_name_result() { } - public get_databases_result( - List success, - MetaException o1) + public drop_partition_by_name_result( + boolean success, + NoSuchObjectException o1, + MetaException o2) { this(); this.success = success; + this.__isset.success = true; this.o1 = o1; + this.o2 = o2; } /** * Performs a deep copy on other. */ - public get_databases_result(get_databases_result other) { - if (other.isSetSuccess()) { - List __this__success = new ArrayList(); - for (String other_element : other.success) { - __this__success.add(other_element); - } - this.success = __this__success; - } + public drop_partition_by_name_result(drop_partition_by_name_result other) { + __isset.success = other.__isset.success; + this.success = other.success; if (other.isSetO1()) { - this.o1 = new MetaException(other.o1); + this.o1 = new NoSuchObjectException(other.o1); + } + if (other.isSetO2()) { + this.o2 = new MetaException(other.o2); } } @Override - public get_databases_result clone() { - return new get_databases_result(this); - } - - public int getSuccessSize() { - return (this.success == null) ? 0 : this.success.size(); - } - - public java.util.Iterator getSuccessIterator() { - return (this.success == null) ? null : this.success.iterator(); - } - - public void addToSuccess(String elem) { - if (this.success == null) { - this.success = new ArrayList(); - } - this.success.add(elem); + public drop_partition_by_name_result clone() { + return new drop_partition_by_name_result(this); } - public List getSuccess() { + public boolean isSuccess() { return this.success; } - public void setSuccess(List success) { + public void setSuccess(boolean success) { this.success = success; + this.__isset.success = true; } public void unsetSuccess() { - this.success = null; + this.__isset.success = false; } // Returns true if field success is set (has been asigned a value) and false otherwise public boolean isSetSuccess() { - return this.success != null; + return this.__isset.success; } - public MetaException getO1() { + public NoSuchObjectException getO1() { return this.o1; } - public void setO1(MetaException o1) { + public void setO1(NoSuchObjectException o1) { this.o1 = o1; } @@ -4761,13 +16795,30 @@ return this.o1 != null; } + public MetaException getO2() { + return this.o2; + } + + public void setO2(MetaException o2) { + this.o2 = o2; + } + + public void unsetO2() { + this.o2 = null; + } + + // Returns true if field o2 is set (has been asigned a value) and false otherwise + public boolean isSetO2() { + return this.o2 != null; + } + public void setFieldValue(int fieldID, Object value) { switch (fieldID) { case SUCCESS: if (value == null) { unsetSuccess(); } else { - setSuccess((List)value); + setSuccess((Boolean)value); } break; @@ -4775,7 +16826,15 @@ if (value == null) { unsetO1(); } else { - setO1((MetaException)value); + setO1((NoSuchObjectException)value); + } + break; + + case O2: + if (value == null) { + unsetO2(); + } else { + setO2((MetaException)value); } break; @@ -4787,11 +16846,14 @@ public Object getFieldValue(int fieldID) { switch (fieldID) { case SUCCESS: - return getSuccess(); + return new Boolean(isSuccess()); case O1: return getO1(); + case O2: + return getO2(); + default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -4804,6 +16866,8 @@ return isSetSuccess(); case O1: return isSetO1(); + case O2: + return isSetO2(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -4813,21 +16877,21 @@ public boolean equals(Object that) { if (that == null) return false; - if (that instanceof get_databases_result) - return this.equals((get_databases_result)that); + if (that instanceof drop_partition_by_name_result) + return this.equals((drop_partition_by_name_result)that); return false; } - public boolean equals(get_databases_result that) { + public boolean equals(drop_partition_by_name_result that) { if (that == null) return false; - boolean this_present_success = true && this.isSetSuccess(); - boolean that_present_success = true && that.isSetSuccess(); + boolean this_present_success = true; + boolean that_present_success = true; if (this_present_success || that_present_success) { if (!(this_present_success && that_present_success)) return false; - if (!this.success.equals(that.success)) + if (this.success != that.success) return false; } @@ -4840,6 +16904,15 @@ return false; } + boolean this_present_o2 = true && this.isSetO2(); + boolean that_present_o2 = true && that.isSetO2(); + if (this_present_o2 || that_present_o2) { + if (!(this_present_o2 && that_present_o2)) + return false; + if (!this.o2.equals(that.o2)) + return false; + } + return true; } @@ -4860,30 +16933,29 @@ switch (field.id) { case SUCCESS: - if (field.type == TType.LIST) { - { - TList _list58 = iprot.readListBegin(); - this.success = new ArrayList(_list58.size); - for (int _i59 = 0; _i59 < _list58.size; ++_i59) - { - String _elem60; - _elem60 = iprot.readString(); - this.success.add(_elem60); - } - iprot.readListEnd(); - } + if (field.type == TType.BOOL) { + this.success = iprot.readBool(); + this.__isset.success = true; } else { TProtocolUtil.skip(iprot, field.type); } break; case O1: if (field.type == TType.STRUCT) { - this.o1 = new MetaException(); + this.o1 = new NoSuchObjectException(); this.o1.read(iprot); } else { TProtocolUtil.skip(iprot, field.type); } break; + case O2: + if (field.type == TType.STRUCT) { + this.o2 = new MetaException(); + this.o2.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; default: TProtocolUtil.skip(iprot, field.type); break; @@ -4900,18 +16972,16 @@ if (this.isSetSuccess()) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - { - oprot.writeListBegin(new TList(TType.STRING, this.success.size())); - for (String _iter61 : this.success) { - oprot.writeString(_iter61); - } - oprot.writeListEnd(); - } + oprot.writeBool(this.success); oprot.writeFieldEnd(); } else if (this.isSetO1()) { oprot.writeFieldBegin(O1_FIELD_DESC); this.o1.write(oprot); oprot.writeFieldEnd(); + } else if (this.isSetO2()) { + oprot.writeFieldBegin(O2_FIELD_DESC); + this.o2.write(oprot); + oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); @@ -4919,15 +16989,11 @@ @Override public String toString() { - StringBuilder sb = new StringBuilder("get_databases_result("); + StringBuilder sb = new StringBuilder("drop_partition_by_name_result("); boolean first = true; sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } + sb.append(this.success); first = false; if (!first) sb.append(", "); sb.append("o1:"); @@ -4937,6 +17003,14 @@ sb.append(this.o1); } first = false; + if (!first) sb.append(", "); + sb.append("o2:"); + if (this.o2 == null) { + sb.append("null"); + } else { + sb.append(this.o2); + } + first = false; sb.append(")"); return sb.toString(); } @@ -4948,32 +17022,167 @@ } - public static class get_all_databases_args implements TBase, java.io.Serializable, Cloneable { - private static final TStruct STRUCT_DESC = new TStruct("get_all_databases_args"); + public static class get_partition_args implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("get_partition_args"); + private static final TField DB_NAME_FIELD_DESC = new TField("db_name", TType.STRING, (short)1); + private static final TField TBL_NAME_FIELD_DESC = new TField("tbl_name", TType.STRING, (short)2); + private static final TField PART_VALS_FIELD_DESC = new TField("part_vals", TType.LIST, (short)3); + + private String db_name; + public static final int DB_NAME = 1; + private String tbl_name; + public static final int TBL_NAME = 2; + private List part_vals; + public static final int PART_VALS = 3; + + private final Isset __isset = new Isset(); + private static final class Isset implements java.io.Serializable { + } public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ + put(DB_NAME, new FieldMetaData("db_name", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + put(TBL_NAME, new FieldMetaData("tbl_name", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + put(PART_VALS, new FieldMetaData("part_vals", TFieldRequirementType.DEFAULT, + new ListMetaData(TType.LIST, + new FieldValueMetaData(TType.STRING)))); }}); static { - FieldMetaData.addStructMetaDataMap(get_all_databases_args.class, metaDataMap); + FieldMetaData.addStructMetaDataMap(get_partition_args.class, metaDataMap); } - public get_all_databases_args() { + public get_partition_args() { + } + + public get_partition_args( + String db_name, + String tbl_name, + List part_vals) + { + this(); + this.db_name = db_name; + this.tbl_name = tbl_name; + this.part_vals = part_vals; } /** * Performs a deep copy on other. */ - public get_all_databases_args(get_all_databases_args other) { + public get_partition_args(get_partition_args other) { + if (other.isSetDb_name()) { + this.db_name = other.db_name; + } + if (other.isSetTbl_name()) { + this.tbl_name = other.tbl_name; + } + if (other.isSetPart_vals()) { + List __this__part_vals = new ArrayList(); + for (String other_element : other.part_vals) { + __this__part_vals.add(other_element); + } + this.part_vals = __this__part_vals; + } } @Override - public get_all_databases_args clone() { - return new get_all_databases_args(this); + public get_partition_args clone() { + return new get_partition_args(this); + } + + public String getDb_name() { + return this.db_name; + } + + public void setDb_name(String db_name) { + this.db_name = db_name; + } + + public void unsetDb_name() { + this.db_name = null; + } + + // Returns true if field db_name is set (has been asigned a value) and false otherwise + public boolean isSetDb_name() { + return this.db_name != null; + } + + public String getTbl_name() { + return this.tbl_name; + } + + public void setTbl_name(String tbl_name) { + this.tbl_name = tbl_name; + } + + public void unsetTbl_name() { + this.tbl_name = null; + } + + // Returns true if field tbl_name is set (has been asigned a value) and false otherwise + public boolean isSetTbl_name() { + return this.tbl_name != null; + } + + public int getPart_valsSize() { + return (this.part_vals == null) ? 0 : this.part_vals.size(); + } + + public java.util.Iterator getPart_valsIterator() { + return (this.part_vals == null) ? null : this.part_vals.iterator(); + } + + public void addToPart_vals(String elem) { + if (this.part_vals == null) { + this.part_vals = new ArrayList(); + } + this.part_vals.add(elem); + } + + public List getPart_vals() { + return this.part_vals; + } + + public void setPart_vals(List part_vals) { + this.part_vals = part_vals; + } + + public void unsetPart_vals() { + this.part_vals = null; + } + + // Returns true if field part_vals is set (has been asigned a value) and false otherwise + public boolean isSetPart_vals() { + return this.part_vals != null; } public void setFieldValue(int fieldID, Object value) { switch (fieldID) { + case DB_NAME: + if (value == null) { + unsetDb_name(); + } else { + setDb_name((String)value); + } + break; + + case TBL_NAME: + if (value == null) { + unsetTbl_name(); + } else { + setTbl_name((String)value); + } + break; + + case PART_VALS: + if (value == null) { + unsetPart_vals(); + } else { + setPart_vals((List)value); + } + break; + default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -4981,6 +17190,15 @@ public Object getFieldValue(int fieldID) { switch (fieldID) { + case DB_NAME: + return getDb_name(); + + case TBL_NAME: + return getTbl_name(); + + case PART_VALS: + return getPart_vals(); + default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -4989,6 +17207,12 @@ // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise public boolean isSet(int fieldID) { switch (fieldID) { + case DB_NAME: + return isSetDb_name(); + case TBL_NAME: + return isSetTbl_name(); + case PART_VALS: + return isSetPart_vals(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -4998,15 +17222,42 @@ public boolean equals(Object that) { if (that == null) return false; - if (that instanceof get_all_databases_args) - return this.equals((get_all_databases_args)that); + if (that instanceof get_partition_args) + return this.equals((get_partition_args)that); return false; } - public boolean equals(get_all_databases_args that) { + public boolean equals(get_partition_args that) { if (that == null) 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) { + if (!(this_present_db_name && that_present_db_name)) + return false; + if (!this.db_name.equals(that.db_name)) + return false; + } + + boolean this_present_tbl_name = true && this.isSetTbl_name(); + boolean that_present_tbl_name = true && that.isSetTbl_name(); + if (this_present_tbl_name || that_present_tbl_name) { + if (!(this_present_tbl_name && that_present_tbl_name)) + return false; + if (!this.tbl_name.equals(that.tbl_name)) + return false; + } + + boolean this_present_part_vals = true && this.isSetPart_vals(); + boolean that_present_part_vals = true && that.isSetPart_vals(); + if (this_present_part_vals || that_present_part_vals) { + if (!(this_present_part_vals && that_present_part_vals)) + return false; + if (!this.part_vals.equals(that.part_vals)) + return false; + } + return true; } @@ -5026,6 +17277,37 @@ } switch (field.id) { + case DB_NAME: + if (field.type == TType.STRING) { + this.db_name = iprot.readString(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case TBL_NAME: + if (field.type == TType.STRING) { + this.tbl_name = iprot.readString(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case PART_VALS: + if (field.type == TType.LIST) { + { + TList _list134 = iprot.readListBegin(); + this.part_vals = new ArrayList(_list134.size); + for (int _i135 = 0; _i135 < _list134.size; ++_i135) + { + String _elem136; + _elem136 = iprot.readString(); + this.part_vals.add(_elem136); + } + iprot.readListEnd(); + } + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; default: TProtocolUtil.skip(iprot, field.type); break; @@ -5041,15 +17323,59 @@ validate(); oprot.writeStructBegin(STRUCT_DESC); + if (this.db_name != null) { + oprot.writeFieldBegin(DB_NAME_FIELD_DESC); + oprot.writeString(this.db_name); + oprot.writeFieldEnd(); + } + if (this.tbl_name != null) { + oprot.writeFieldBegin(TBL_NAME_FIELD_DESC); + oprot.writeString(this.tbl_name); + oprot.writeFieldEnd(); + } + if (this.part_vals != null) { + oprot.writeFieldBegin(PART_VALS_FIELD_DESC); + { + oprot.writeListBegin(new TList(TType.STRING, this.part_vals.size())); + for (String _iter137 : this.part_vals) { + oprot.writeString(_iter137); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } oprot.writeFieldStop(); oprot.writeStructEnd(); } @Override public String toString() { - StringBuilder sb = new StringBuilder("get_all_databases_args("); + StringBuilder sb = new StringBuilder("get_partition_args("); boolean first = true; + sb.append("db_name:"); + if (this.db_name == null) { + sb.append("null"); + } else { + sb.append(this.db_name); + } + first = false; + if (!first) sb.append(", "); + sb.append("tbl_name:"); + if (this.tbl_name == null) { + sb.append("null"); + } else { + sb.append(this.tbl_name); + } + first = false; + if (!first) sb.append(", "); + sb.append("part_vals:"); + if (this.part_vals == null) { + sb.append("null"); + } else { + sb.append(this.part_vals); + } + first = false; sb.append(")"); return sb.toString(); } @@ -5061,15 +17387,18 @@ } - public static class get_all_databases_result implements TBase, java.io.Serializable, Cloneable { - private static final TStruct STRUCT_DESC = new TStruct("get_all_databases_result"); - private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.LIST, (short)0); + public static class get_partition_result implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("get_partition_result"); + private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.STRUCT, (short)0); private static final TField O1_FIELD_DESC = new TField("o1", TType.STRUCT, (short)1); + private static final TField O2_FIELD_DESC = new TField("o2", TType.STRUCT, (short)2); - private List success; + private Partition success; public static final int SUCCESS = 0; private MetaException o1; public static final int O1 = 1; + private NoSuchObjectException o2; + public static final int O2 = 2; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { @@ -5077,69 +17406,56 @@ public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ put(SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, - new ListMetaData(TType.LIST, - new FieldValueMetaData(TType.STRING)))); + new StructMetaData(TType.STRUCT, Partition.class))); put(O1, new FieldMetaData("o1", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRUCT))); + put(O2, new FieldMetaData("o2", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRUCT))); }}); static { - FieldMetaData.addStructMetaDataMap(get_all_databases_result.class, metaDataMap); + FieldMetaData.addStructMetaDataMap(get_partition_result.class, metaDataMap); } - public get_all_databases_result() { + public get_partition_result() { } - public get_all_databases_result( - List success, - MetaException o1) + public get_partition_result( + Partition success, + MetaException o1, + NoSuchObjectException o2) { this(); this.success = success; this.o1 = o1; + this.o2 = o2; } /** * Performs a deep copy on other. */ - public get_all_databases_result(get_all_databases_result other) { + public get_partition_result(get_partition_result other) { if (other.isSetSuccess()) { - List __this__success = new ArrayList(); - for (String other_element : other.success) { - __this__success.add(other_element); - } - this.success = __this__success; + this.success = new Partition(other.success); } if (other.isSetO1()) { this.o1 = new MetaException(other.o1); } + if (other.isSetO2()) { + this.o2 = new NoSuchObjectException(other.o2); + } } @Override - public get_all_databases_result clone() { - return new get_all_databases_result(this); - } - - public int getSuccessSize() { - return (this.success == null) ? 0 : this.success.size(); - } - - public java.util.Iterator getSuccessIterator() { - return (this.success == null) ? null : this.success.iterator(); - } - - public void addToSuccess(String elem) { - if (this.success == null) { - this.success = new ArrayList(); - } - this.success.add(elem); + public get_partition_result clone() { + return new get_partition_result(this); } - public List getSuccess() { + public Partition getSuccess() { return this.success; } - public void setSuccess(List success) { + public void setSuccess(Partition success) { this.success = success; } @@ -5169,13 +17485,30 @@ return this.o1 != null; } + public NoSuchObjectException getO2() { + return this.o2; + } + + public void setO2(NoSuchObjectException o2) { + this.o2 = o2; + } + + public void unsetO2() { + this.o2 = null; + } + + // Returns true if field o2 is set (has been asigned a value) and false otherwise + public boolean isSetO2() { + return this.o2 != null; + } + public void setFieldValue(int fieldID, Object value) { switch (fieldID) { case SUCCESS: if (value == null) { unsetSuccess(); } else { - setSuccess((List)value); + setSuccess((Partition)value); } break; @@ -5187,6 +17520,14 @@ } break; + case O2: + if (value == null) { + unsetO2(); + } else { + setO2((NoSuchObjectException)value); + } + break; + default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -5200,6 +17541,9 @@ case O1: return getO1(); + case O2: + return getO2(); + default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -5212,6 +17556,8 @@ return isSetSuccess(); case O1: return isSetO1(); + case O2: + return isSetO2(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -5221,12 +17567,12 @@ public boolean equals(Object that) { if (that == null) return false; - if (that instanceof get_all_databases_result) - return this.equals((get_all_databases_result)that); + if (that instanceof get_partition_result) + return this.equals((get_partition_result)that); return false; } - public boolean equals(get_all_databases_result that) { + public boolean equals(get_partition_result that) { if (that == null) return false; @@ -5248,6 +17594,15 @@ return false; } + boolean this_present_o2 = true && this.isSetO2(); + boolean that_present_o2 = true && that.isSetO2(); + if (this_present_o2 || that_present_o2) { + if (!(this_present_o2 && that_present_o2)) + return false; + if (!this.o2.equals(that.o2)) + return false; + } + return true; } @@ -5268,18 +17623,9 @@ switch (field.id) { case SUCCESS: - if (field.type == TType.LIST) { - { - TList _list62 = iprot.readListBegin(); - this.success = new ArrayList(_list62.size); - for (int _i63 = 0; _i63 < _list62.size; ++_i63) - { - String _elem64; - _elem64 = iprot.readString(); - this.success.add(_elem64); - } - iprot.readListEnd(); - } + if (field.type == TType.STRUCT) { + this.success = new Partition(); + this.success.read(iprot); } else { TProtocolUtil.skip(iprot, field.type); } @@ -5292,6 +17638,14 @@ TProtocolUtil.skip(iprot, field.type); } break; + case O2: + if (field.type == TType.STRUCT) { + this.o2 = new NoSuchObjectException(); + this.o2.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; default: TProtocolUtil.skip(iprot, field.type); break; @@ -5308,18 +17662,16 @@ if (this.isSetSuccess()) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - { - oprot.writeListBegin(new TList(TType.STRING, this.success.size())); - for (String _iter65 : this.success) { - oprot.writeString(_iter65); - } - oprot.writeListEnd(); - } + this.success.write(oprot); oprot.writeFieldEnd(); } else if (this.isSetO1()) { oprot.writeFieldBegin(O1_FIELD_DESC); this.o1.write(oprot); oprot.writeFieldEnd(); + } else if (this.isSetO2()) { + oprot.writeFieldBegin(O2_FIELD_DESC); + this.o2.write(oprot); + oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); @@ -5327,7 +17679,7 @@ @Override public String toString() { - StringBuilder sb = new StringBuilder("get_all_databases_result("); + StringBuilder sb = new StringBuilder("get_partition_result("); boolean first = true; sb.append("success:"); @@ -5345,6 +17697,14 @@ sb.append(this.o1); } first = false; + if (!first) sb.append(", "); + sb.append("o2:"); + if (this.o2 == null) { + sb.append("null"); + } else { + sb.append(this.o2); + } + first = false; sb.append(")"); return sb.toString(); } @@ -5356,74 +17716,144 @@ } - public static class get_type_args implements TBase, java.io.Serializable, Cloneable { - private static final TStruct STRUCT_DESC = new TStruct("get_type_args"); - private static final TField NAME_FIELD_DESC = new TField("name", TType.STRING, (short)1); + public static class get_partition_by_name_args implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("get_partition_by_name_args"); + private static final TField DB_NAME_FIELD_DESC = new TField("db_name", TType.STRING, (short)1); + private static final TField TBL_NAME_FIELD_DESC = new TField("tbl_name", TType.STRING, (short)2); + private static final TField PART_NAME_FIELD_DESC = new TField("part_name", TType.STRING, (short)3); - private String name; - public static final int NAME = 1; + private String db_name; + public static final int DB_NAME = 1; + private String tbl_name; + public static final int TBL_NAME = 2; + private String part_name; + public static final int PART_NAME = 3; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { } public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ - put(NAME, new FieldMetaData("name", TFieldRequirementType.DEFAULT, + put(DB_NAME, new FieldMetaData("db_name", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + put(TBL_NAME, new FieldMetaData("tbl_name", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + put(PART_NAME, new FieldMetaData("part_name", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRING))); }}); static { - FieldMetaData.addStructMetaDataMap(get_type_args.class, metaDataMap); + FieldMetaData.addStructMetaDataMap(get_partition_by_name_args.class, metaDataMap); } - public get_type_args() { + public get_partition_by_name_args() { } - public get_type_args( - String name) + public get_partition_by_name_args( + String db_name, + String tbl_name, + String part_name) { this(); - this.name = name; + this.db_name = db_name; + this.tbl_name = tbl_name; + this.part_name = part_name; } /** * Performs a deep copy on other. */ - public get_type_args(get_type_args other) { - if (other.isSetName()) { - this.name = other.name; + public get_partition_by_name_args(get_partition_by_name_args other) { + if (other.isSetDb_name()) { + this.db_name = other.db_name; + } + if (other.isSetTbl_name()) { + this.tbl_name = other.tbl_name; + } + if (other.isSetPart_name()) { + this.part_name = other.part_name; } } @Override - public get_type_args clone() { - return new get_type_args(this); + public get_partition_by_name_args clone() { + return new get_partition_by_name_args(this); } - public String getName() { - return this.name; + public String getDb_name() { + return this.db_name; } - public void setName(String name) { - this.name = name; + public void setDb_name(String db_name) { + this.db_name = db_name; } - public void unsetName() { - this.name = null; + public void unsetDb_name() { + this.db_name = null; } - // Returns true if field name is set (has been asigned a value) and false otherwise - public boolean isSetName() { - return this.name != null; + // Returns true if field db_name is set (has been asigned a value) and false otherwise + public boolean isSetDb_name() { + return this.db_name != null; + } + + public String getTbl_name() { + return this.tbl_name; + } + + public void setTbl_name(String tbl_name) { + this.tbl_name = tbl_name; + } + + public void unsetTbl_name() { + this.tbl_name = null; + } + + // Returns true if field tbl_name is set (has been asigned a value) and false otherwise + public boolean isSetTbl_name() { + return this.tbl_name != null; + } + + public String getPart_name() { + return this.part_name; + } + + public void setPart_name(String part_name) { + this.part_name = part_name; + } + + public void unsetPart_name() { + this.part_name = null; + } + + // Returns true if field part_name is set (has been asigned a value) and false otherwise + public boolean isSetPart_name() { + return this.part_name != null; } public void setFieldValue(int fieldID, Object value) { switch (fieldID) { - case NAME: + case DB_NAME: if (value == null) { - unsetName(); + unsetDb_name(); } else { - setName((String)value); + setDb_name((String)value); + } + break; + + case TBL_NAME: + if (value == null) { + unsetTbl_name(); + } else { + setTbl_name((String)value); + } + break; + + case PART_NAME: + if (value == null) { + unsetPart_name(); + } else { + setPart_name((String)value); } break; @@ -5434,8 +17864,14 @@ public Object getFieldValue(int fieldID) { switch (fieldID) { - case NAME: - return getName(); + case DB_NAME: + return getDb_name(); + + case TBL_NAME: + return getTbl_name(); + + case PART_NAME: + return getPart_name(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); @@ -5445,8 +17881,12 @@ // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise public boolean isSet(int fieldID) { switch (fieldID) { - case NAME: - return isSetName(); + case DB_NAME: + return isSetDb_name(); + case TBL_NAME: + return isSetTbl_name(); + case PART_NAME: + return isSetPart_name(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -5456,21 +17896,39 @@ public boolean equals(Object that) { if (that == null) return false; - if (that instanceof get_type_args) - return this.equals((get_type_args)that); + if (that instanceof get_partition_by_name_args) + return this.equals((get_partition_by_name_args)that); return false; } - public boolean equals(get_type_args that) { + public boolean equals(get_partition_by_name_args 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)) + 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) { + if (!(this_present_db_name && that_present_db_name)) return false; - if (!this.name.equals(that.name)) + if (!this.db_name.equals(that.db_name)) + return false; + } + + boolean this_present_tbl_name = true && this.isSetTbl_name(); + boolean that_present_tbl_name = true && that.isSetTbl_name(); + if (this_present_tbl_name || that_present_tbl_name) { + if (!(this_present_tbl_name && that_present_tbl_name)) + return false; + if (!this.tbl_name.equals(that.tbl_name)) + return false; + } + + boolean this_present_part_name = true && this.isSetPart_name(); + boolean that_present_part_name = true && that.isSetPart_name(); + if (this_present_part_name || that_present_part_name) { + if (!(this_present_part_name && that_present_part_name)) + return false; + if (!this.part_name.equals(that.part_name)) return false; } @@ -5493,9 +17951,23 @@ } switch (field.id) { - case NAME: + case DB_NAME: if (field.type == TType.STRING) { - this.name = iprot.readString(); + this.db_name = iprot.readString(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case TBL_NAME: + if (field.type == TType.STRING) { + this.tbl_name = iprot.readString(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case PART_NAME: + if (field.type == TType.STRING) { + this.part_name = iprot.readString(); } else { TProtocolUtil.skip(iprot, field.type); } @@ -5515,9 +17987,19 @@ validate(); oprot.writeStructBegin(STRUCT_DESC); - if (this.name != null) { - oprot.writeFieldBegin(NAME_FIELD_DESC); - oprot.writeString(this.name); + if (this.db_name != null) { + oprot.writeFieldBegin(DB_NAME_FIELD_DESC); + oprot.writeString(this.db_name); + oprot.writeFieldEnd(); + } + if (this.tbl_name != null) { + oprot.writeFieldBegin(TBL_NAME_FIELD_DESC); + oprot.writeString(this.tbl_name); + oprot.writeFieldEnd(); + } + if (this.part_name != null) { + oprot.writeFieldBegin(PART_NAME_FIELD_DESC); + oprot.writeString(this.part_name); oprot.writeFieldEnd(); } oprot.writeFieldStop(); @@ -5526,14 +18008,30 @@ @Override public String toString() { - StringBuilder sb = new StringBuilder("get_type_args("); + StringBuilder sb = new StringBuilder("get_partition_by_name_args("); boolean first = true; - sb.append("name:"); - if (this.name == null) { + sb.append("db_name:"); + if (this.db_name == null) { sb.append("null"); } else { - sb.append(this.name); + sb.append(this.db_name); + } + first = false; + if (!first) sb.append(", "); + sb.append("tbl_name:"); + if (this.tbl_name == null) { + sb.append("null"); + } else { + sb.append(this.tbl_name); + } + first = false; + if (!first) sb.append(", "); + sb.append("part_name:"); + if (this.part_name == null) { + sb.append("null"); + } else { + sb.append(this.part_name); } first = false; sb.append(")"); @@ -5547,13 +18045,13 @@ } - public static class get_type_result implements TBase, java.io.Serializable, Cloneable { - private static final TStruct STRUCT_DESC = new TStruct("get_type_result"); + public static class get_partition_by_name_result implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("get_partition_by_name_result"); private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.STRUCT, (short)0); private static final TField O1_FIELD_DESC = new TField("o1", TType.STRUCT, (short)1); private static final TField O2_FIELD_DESC = new TField("o2", TType.STRUCT, (short)2); - private Type success; + private Partition success; public static final int SUCCESS = 0; private MetaException o1; public static final int O1 = 1; @@ -5566,7 +18064,7 @@ public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ put(SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, - new StructMetaData(TType.STRUCT, Type.class))); + new StructMetaData(TType.STRUCT, Partition.class))); put(O1, new FieldMetaData("o1", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRUCT))); put(O2, new FieldMetaData("o2", TFieldRequirementType.DEFAULT, @@ -5574,14 +18072,14 @@ }}); static { - FieldMetaData.addStructMetaDataMap(get_type_result.class, metaDataMap); + FieldMetaData.addStructMetaDataMap(get_partition_by_name_result.class, metaDataMap); } - public get_type_result() { + public get_partition_by_name_result() { } - public get_type_result( - Type success, + public get_partition_by_name_result( + Partition success, MetaException o1, NoSuchObjectException o2) { @@ -5594,9 +18092,9 @@ /** * Performs a deep copy on other. */ - public get_type_result(get_type_result other) { + public get_partition_by_name_result(get_partition_by_name_result other) { if (other.isSetSuccess()) { - this.success = new Type(other.success); + this.success = new Partition(other.success); } if (other.isSetO1()) { this.o1 = new MetaException(other.o1); @@ -5607,15 +18105,15 @@ } @Override - public get_type_result clone() { - return new get_type_result(this); + public get_partition_by_name_result clone() { + return new get_partition_by_name_result(this); } - public Type getSuccess() { + public Partition getSuccess() { return this.success; } - public void setSuccess(Type success) { + public void setSuccess(Partition success) { this.success = success; } @@ -5668,7 +18166,7 @@ if (value == null) { unsetSuccess(); } else { - setSuccess((Type)value); + setSuccess((Partition)value); } break; @@ -5727,12 +18225,12 @@ public boolean equals(Object that) { if (that == null) return false; - if (that instanceof get_type_result) - return this.equals((get_type_result)that); + if (that instanceof get_partition_by_name_result) + return this.equals((get_partition_by_name_result)that); return false; } - public boolean equals(get_type_result that) { + public boolean equals(get_partition_by_name_result that) { if (that == null) return false; @@ -5784,7 +18282,7 @@ { case SUCCESS: if (field.type == TType.STRUCT) { - this.success = new Type(); + this.success = new Partition(); this.success.read(iprot); } else { TProtocolUtil.skip(iprot, field.type); @@ -5839,7 +18337,7 @@ @Override public String toString() { - StringBuilder sb = new StringBuilder("get_type_result("); + StringBuilder sb = new StringBuilder("get_partition_by_name_result("); boolean first = true; sb.append("success:"); @@ -5876,74 +18374,148 @@ } - public static class create_type_args implements TBase, java.io.Serializable, Cloneable { - private static final TStruct STRUCT_DESC = new TStruct("create_type_args"); - private static final TField TYPE_FIELD_DESC = new TField("type", TType.STRUCT, (short)1); + public static class get_partitions_args implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("get_partitions_args"); + private static final TField DB_NAME_FIELD_DESC = new TField("db_name", TType.STRING, (short)1); + private static final TField TBL_NAME_FIELD_DESC = new TField("tbl_name", TType.STRING, (short)2); + private static final TField MAX_PARTS_FIELD_DESC = new TField("max_parts", TType.I16, (short)3); - private Type type; - public static final int TYPE = 1; + private String db_name; + public static final int DB_NAME = 1; + private String tbl_name; + public static final int TBL_NAME = 2; + private short max_parts; + public static final int MAX_PARTS = 3; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { + public boolean max_parts = false; } public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ - put(TYPE, new FieldMetaData("type", TFieldRequirementType.DEFAULT, - new StructMetaData(TType.STRUCT, Type.class))); + put(DB_NAME, new FieldMetaData("db_name", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + put(TBL_NAME, new FieldMetaData("tbl_name", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + put(MAX_PARTS, new FieldMetaData("max_parts", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.I16))); }}); static { - FieldMetaData.addStructMetaDataMap(create_type_args.class, metaDataMap); + FieldMetaData.addStructMetaDataMap(get_partitions_args.class, metaDataMap); } - public create_type_args() { + public get_partitions_args() { + this.max_parts = (short)-1; + } - public create_type_args( - Type type) + public get_partitions_args( + String db_name, + String tbl_name, + short max_parts) { this(); - this.type = type; + this.db_name = db_name; + this.tbl_name = tbl_name; + this.max_parts = max_parts; + this.__isset.max_parts = true; } /** * Performs a deep copy on other. */ - public create_type_args(create_type_args other) { - if (other.isSetType()) { - this.type = new Type(other.type); + public get_partitions_args(get_partitions_args other) { + if (other.isSetDb_name()) { + this.db_name = other.db_name; + } + if (other.isSetTbl_name()) { + this.tbl_name = other.tbl_name; } + __isset.max_parts = other.__isset.max_parts; + this.max_parts = other.max_parts; } @Override - public create_type_args clone() { - return new create_type_args(this); + public get_partitions_args clone() { + return new get_partitions_args(this); } - public Type getType() { - return this.type; + public String getDb_name() { + return this.db_name; } - public void setType(Type type) { - this.type = type; + public void setDb_name(String db_name) { + this.db_name = db_name; } - public void unsetType() { - this.type = null; + public void unsetDb_name() { + this.db_name = null; } - // Returns true if field type is set (has been asigned a value) and false otherwise - public boolean isSetType() { - return this.type != null; + // Returns true if field db_name is set (has been asigned a value) and false otherwise + public boolean isSetDb_name() { + return this.db_name != null; + } + + public String getTbl_name() { + return this.tbl_name; + } + + public void setTbl_name(String tbl_name) { + this.tbl_name = tbl_name; + } + + public void unsetTbl_name() { + this.tbl_name = null; + } + + // Returns true if field tbl_name is set (has been asigned a value) and false otherwise + public boolean isSetTbl_name() { + return this.tbl_name != null; + } + + public short getMax_parts() { + return this.max_parts; + } + + public void setMax_parts(short max_parts) { + this.max_parts = max_parts; + this.__isset.max_parts = true; + } + + public void unsetMax_parts() { + this.__isset.max_parts = false; + } + + // Returns true if field max_parts is set (has been asigned a value) and false otherwise + public boolean isSetMax_parts() { + return this.__isset.max_parts; } public void setFieldValue(int fieldID, Object value) { switch (fieldID) { - case TYPE: + case DB_NAME: if (value == null) { - unsetType(); + unsetDb_name(); } else { - setType((Type)value); + setDb_name((String)value); + } + break; + + case TBL_NAME: + if (value == null) { + unsetTbl_name(); + } else { + setTbl_name((String)value); + } + break; + + case MAX_PARTS: + if (value == null) { + unsetMax_parts(); + } else { + setMax_parts((Short)value); } break; @@ -5954,8 +18526,14 @@ public Object getFieldValue(int fieldID) { switch (fieldID) { - case TYPE: - return getType(); + case DB_NAME: + return getDb_name(); + + case TBL_NAME: + return getTbl_name(); + + case MAX_PARTS: + return new Short(getMax_parts()); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); @@ -5965,8 +18543,12 @@ // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise public boolean isSet(int fieldID) { switch (fieldID) { - case TYPE: - return isSetType(); + case DB_NAME: + return isSetDb_name(); + case TBL_NAME: + return isSetTbl_name(); + case MAX_PARTS: + return isSetMax_parts(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -5976,21 +18558,39 @@ public boolean equals(Object that) { if (that == null) return false; - if (that instanceof create_type_args) - return this.equals((create_type_args)that); + if (that instanceof get_partitions_args) + return this.equals((get_partitions_args)that); return false; } - public boolean equals(create_type_args that) { + public boolean equals(get_partitions_args that) { if (that == null) return false; - boolean this_present_type = true && this.isSetType(); - boolean that_present_type = true && that.isSetType(); - if (this_present_type || that_present_type) { - if (!(this_present_type && that_present_type)) + 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) { + if (!(this_present_db_name && that_present_db_name)) return false; - if (!this.type.equals(that.type)) + if (!this.db_name.equals(that.db_name)) + return false; + } + + boolean this_present_tbl_name = true && this.isSetTbl_name(); + boolean that_present_tbl_name = true && that.isSetTbl_name(); + if (this_present_tbl_name || that_present_tbl_name) { + if (!(this_present_tbl_name && that_present_tbl_name)) + return false; + if (!this.tbl_name.equals(that.tbl_name)) + return false; + } + + boolean this_present_max_parts = true; + boolean that_present_max_parts = true; + if (this_present_max_parts || that_present_max_parts) { + if (!(this_present_max_parts && that_present_max_parts)) + return false; + if (this.max_parts != that.max_parts) return false; } @@ -6013,10 +18613,24 @@ } switch (field.id) { - case TYPE: - if (field.type == TType.STRUCT) { - this.type = new Type(); - this.type.read(iprot); + case DB_NAME: + if (field.type == TType.STRING) { + this.db_name = iprot.readString(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case TBL_NAME: + if (field.type == TType.STRING) { + this.tbl_name = iprot.readString(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case MAX_PARTS: + if (field.type == TType.I16) { + this.max_parts = iprot.readI16(); + this.__isset.max_parts = true; } else { TProtocolUtil.skip(iprot, field.type); } @@ -6036,27 +18650,47 @@ validate(); oprot.writeStructBegin(STRUCT_DESC); - if (this.type != null) { - oprot.writeFieldBegin(TYPE_FIELD_DESC); - this.type.write(oprot); + if (this.db_name != null) { + oprot.writeFieldBegin(DB_NAME_FIELD_DESC); + oprot.writeString(this.db_name); + oprot.writeFieldEnd(); + } + if (this.tbl_name != null) { + oprot.writeFieldBegin(TBL_NAME_FIELD_DESC); + oprot.writeString(this.tbl_name); oprot.writeFieldEnd(); } + oprot.writeFieldBegin(MAX_PARTS_FIELD_DESC); + oprot.writeI16(this.max_parts); + oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } @Override public String toString() { - StringBuilder sb = new StringBuilder("create_type_args("); + StringBuilder sb = new StringBuilder("get_partitions_args("); boolean first = true; - sb.append("type:"); - if (this.type == null) { + sb.append("db_name:"); + if (this.db_name == null) { sb.append("null"); } else { - sb.append(this.type); + sb.append(this.db_name); + } + first = false; + if (!first) sb.append(", "); + sb.append("tbl_name:"); + if (this.tbl_name == null) { + sb.append("null"); + } else { + sb.append(this.tbl_name); } first = false; + if (!first) sb.append(", "); + sb.append("max_parts:"); + sb.append(this.max_parts); + first = false; sb.append(")"); return sb.toString(); } @@ -6068,104 +18702,112 @@ } - public static class create_type_result implements TBase, java.io.Serializable, Cloneable { - private static final TStruct STRUCT_DESC = new TStruct("create_type_result"); - private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.BOOL, (short)0); + public static class get_partitions_result implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("get_partitions_result"); + private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.LIST, (short)0); private static final TField O1_FIELD_DESC = new TField("o1", TType.STRUCT, (short)1); private static final TField O2_FIELD_DESC = new TField("o2", TType.STRUCT, (short)2); - private static final TField O3_FIELD_DESC = new TField("o3", TType.STRUCT, (short)3); - private boolean success; + private List success; public static final int SUCCESS = 0; - private AlreadyExistsException o1; + private NoSuchObjectException o1; public static final int O1 = 1; - private InvalidObjectException o2; + private MetaException o2; public static final int O2 = 2; - private MetaException o3; - public static final int O3 = 3; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { - public boolean success = false; } public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ put(SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.BOOL))); + new ListMetaData(TType.LIST, + new StructMetaData(TType.STRUCT, Partition.class)))); put(O1, new FieldMetaData("o1", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRUCT))); put(O2, new FieldMetaData("o2", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRUCT))); - put(O3, new FieldMetaData("o3", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRUCT))); }}); static { - FieldMetaData.addStructMetaDataMap(create_type_result.class, metaDataMap); + FieldMetaData.addStructMetaDataMap(get_partitions_result.class, metaDataMap); } - public create_type_result() { + public get_partitions_result() { } - public create_type_result( - boolean success, - AlreadyExistsException o1, - InvalidObjectException o2, - MetaException o3) + public get_partitions_result( + List success, + NoSuchObjectException o1, + MetaException o2) { this(); this.success = success; - this.__isset.success = true; this.o1 = o1; this.o2 = o2; - this.o3 = o3; } /** * Performs a deep copy on other. */ - public create_type_result(create_type_result other) { - __isset.success = other.__isset.success; - this.success = other.success; + public get_partitions_result(get_partitions_result other) { + if (other.isSetSuccess()) { + List __this__success = new ArrayList(); + for (Partition other_element : other.success) { + __this__success.add(new Partition(other_element)); + } + this.success = __this__success; + } if (other.isSetO1()) { - this.o1 = new AlreadyExistsException(other.o1); + this.o1 = new NoSuchObjectException(other.o1); } if (other.isSetO2()) { - this.o2 = new InvalidObjectException(other.o2); - } - if (other.isSetO3()) { - this.o3 = new MetaException(other.o3); + this.o2 = new MetaException(other.o2); } } @Override - public create_type_result clone() { - return new create_type_result(this); + public get_partitions_result clone() { + return new get_partitions_result(this); } - public boolean isSuccess() { + public int getSuccessSize() { + return (this.success == null) ? 0 : this.success.size(); + } + + public java.util.Iterator getSuccessIterator() { + return (this.success == null) ? null : this.success.iterator(); + } + + public void addToSuccess(Partition elem) { + if (this.success == null) { + this.success = new ArrayList(); + } + this.success.add(elem); + } + + public List getSuccess() { return this.success; } - public void setSuccess(boolean success) { + public void setSuccess(List success) { this.success = success; - this.__isset.success = true; } public void unsetSuccess() { - this.__isset.success = false; + this.success = null; } // Returns true if field success is set (has been asigned a value) and false otherwise public boolean isSetSuccess() { - return this.__isset.success; + return this.success != null; } - public AlreadyExistsException getO1() { + public NoSuchObjectException getO1() { return this.o1; } - public void setO1(AlreadyExistsException o1) { + public void setO1(NoSuchObjectException o1) { this.o1 = o1; } @@ -6178,11 +18820,11 @@ return this.o1 != null; } - public InvalidObjectException getO2() { + public MetaException getO2() { return this.o2; } - public void setO2(InvalidObjectException o2) { + public void setO2(MetaException o2) { this.o2 = o2; } @@ -6195,30 +18837,13 @@ return this.o2 != null; } - public MetaException getO3() { - return this.o3; - } - - public void setO3(MetaException o3) { - this.o3 = o3; - } - - public void unsetO3() { - this.o3 = null; - } - - // Returns true if field o3 is set (has been asigned a value) and false otherwise - public boolean isSetO3() { - return this.o3 != null; - } - public void setFieldValue(int fieldID, Object value) { switch (fieldID) { case SUCCESS: if (value == null) { unsetSuccess(); } else { - setSuccess((Boolean)value); + setSuccess((List)value); } break; @@ -6226,7 +18851,7 @@ if (value == null) { unsetO1(); } else { - setO1((AlreadyExistsException)value); + setO1((NoSuchObjectException)value); } break; @@ -6234,15 +18859,7 @@ if (value == null) { unsetO2(); } else { - setO2((InvalidObjectException)value); - } - break; - - case O3: - if (value == null) { - unsetO3(); - } else { - setO3((MetaException)value); + setO2((MetaException)value); } break; @@ -6254,7 +18871,7 @@ public Object getFieldValue(int fieldID) { switch (fieldID) { case SUCCESS: - return new Boolean(isSuccess()); + return getSuccess(); case O1: return getO1(); @@ -6262,9 +18879,6 @@ case O2: return getO2(); - case O3: - return getO3(); - default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -6279,8 +18893,6 @@ return isSetO1(); case O2: return isSetO2(); - case O3: - return isSetO3(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -6290,21 +18902,21 @@ public boolean equals(Object that) { if (that == null) return false; - if (that instanceof create_type_result) - return this.equals((create_type_result)that); + if (that instanceof get_partitions_result) + return this.equals((get_partitions_result)that); return false; } - public boolean equals(create_type_result that) { + public boolean equals(get_partitions_result that) { if (that == null) return false; - boolean this_present_success = true; - boolean that_present_success = true; + boolean this_present_success = true && this.isSetSuccess(); + boolean that_present_success = true && that.isSetSuccess(); if (this_present_success || that_present_success) { if (!(this_present_success && that_present_success)) return false; - if (this.success != that.success) + if (!this.success.equals(that.success)) return false; } @@ -6326,15 +18938,6 @@ return false; } - boolean this_present_o3 = true && this.isSetO3(); - boolean that_present_o3 = true && that.isSetO3(); - if (this_present_o3 || that_present_o3) { - if (!(this_present_o3 && that_present_o3)) - return false; - if (!this.o3.equals(that.o3)) - return false; - } - return true; } @@ -6355,16 +18958,26 @@ switch (field.id) { case SUCCESS: - if (field.type == TType.BOOL) { - this.success = iprot.readBool(); - this.__isset.success = true; + if (field.type == TType.LIST) { + { + TList _list138 = iprot.readListBegin(); + this.success = new ArrayList(_list138.size); + for (int _i139 = 0; _i139 < _list138.size; ++_i139) + { + Partition _elem140; + _elem140 = new Partition(); + _elem140.read(iprot); + this.success.add(_elem140); + } + iprot.readListEnd(); + } } else { TProtocolUtil.skip(iprot, field.type); } break; case O1: if (field.type == TType.STRUCT) { - this.o1 = new AlreadyExistsException(); + this.o1 = new NoSuchObjectException(); this.o1.read(iprot); } else { TProtocolUtil.skip(iprot, field.type); @@ -6372,20 +18985,12 @@ break; case O2: if (field.type == TType.STRUCT) { - this.o2 = new InvalidObjectException(); + this.o2 = new MetaException(); this.o2.read(iprot); } else { TProtocolUtil.skip(iprot, field.type); } break; - case O3: - if (field.type == TType.STRUCT) { - this.o3 = new MetaException(); - this.o3.read(iprot); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; default: TProtocolUtil.skip(iprot, field.type); break; @@ -6402,7 +19007,13 @@ if (this.isSetSuccess()) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - oprot.writeBool(this.success); + { + oprot.writeListBegin(new TList(TType.STRUCT, this.success.size())); + for (Partition _iter141 : this.success) { + _iter141.write(oprot); + } + oprot.writeListEnd(); + } oprot.writeFieldEnd(); } else if (this.isSetO1()) { oprot.writeFieldBegin(O1_FIELD_DESC); @@ -6412,10 +19023,6 @@ oprot.writeFieldBegin(O2_FIELD_DESC); this.o2.write(oprot); oprot.writeFieldEnd(); - } else if (this.isSetO3()) { - oprot.writeFieldBegin(O3_FIELD_DESC); - this.o3.write(oprot); - oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); @@ -6423,11 +19030,15 @@ @Override public String toString() { - StringBuilder sb = new StringBuilder("create_type_result("); + StringBuilder sb = new StringBuilder("get_partitions_result("); boolean first = true; sb.append("success:"); - sb.append(this.success); + if (this.success == null) { + sb.append("null"); + } else { + sb.append(this.success); + } first = false; if (!first) sb.append(", "); sb.append("o1:"); @@ -6445,93 +19056,159 @@ sb.append(this.o2); } first = false; - if (!first) sb.append(", "); - sb.append("o3:"); - if (this.o3 == null) { - sb.append("null"); - } else { - sb.append(this.o3); - } - first = false; sb.append(")"); return sb.toString(); } - public void validate() throws TException { - // check for required fields - // check that fields of type enum have valid values + public void validate() throws TException { + // check for required fields + // check that fields of type enum have valid values + } + + } + + public static class get_partition_names_args implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("get_partition_names_args"); + private static final TField DB_NAME_FIELD_DESC = new TField("db_name", TType.STRING, (short)1); + private static final TField TBL_NAME_FIELD_DESC = new TField("tbl_name", TType.STRING, (short)2); + private static final TField MAX_PARTS_FIELD_DESC = new TField("max_parts", TType.I16, (short)3); + + private String db_name; + public static final int DB_NAME = 1; + private String tbl_name; + public static final int TBL_NAME = 2; + private short max_parts; + public static final int MAX_PARTS = 3; + + private final Isset __isset = new Isset(); + private static final class Isset implements java.io.Serializable { + public boolean max_parts = false; + } + + public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ + put(DB_NAME, new FieldMetaData("db_name", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + put(TBL_NAME, new FieldMetaData("tbl_name", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + put(MAX_PARTS, new FieldMetaData("max_parts", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.I16))); + }}); + + static { + FieldMetaData.addStructMetaDataMap(get_partition_names_args.class, metaDataMap); + } + + public get_partition_names_args() { + this.max_parts = (short)-1; + + } + + public get_partition_names_args( + String db_name, + String tbl_name, + short max_parts) + { + this(); + this.db_name = db_name; + this.tbl_name = tbl_name; + this.max_parts = max_parts; + this.__isset.max_parts = true; + } + + /** + * Performs a deep copy on other. + */ + public get_partition_names_args(get_partition_names_args other) { + if (other.isSetDb_name()) { + this.db_name = other.db_name; + } + if (other.isSetTbl_name()) { + this.tbl_name = other.tbl_name; + } + __isset.max_parts = other.__isset.max_parts; + this.max_parts = other.max_parts; + } + + @Override + public get_partition_names_args clone() { + return new get_partition_names_args(this); } - } - - public static class drop_type_args implements TBase, java.io.Serializable, Cloneable { - private static final TStruct STRUCT_DESC = new TStruct("drop_type_args"); - private static final TField TYPE_FIELD_DESC = new TField("type", TType.STRING, (short)1); - - private String type; - public static final int TYPE = 1; + public String getDb_name() { + return this.db_name; + } - private final Isset __isset = new Isset(); - private static final class Isset implements java.io.Serializable { + public void setDb_name(String db_name) { + this.db_name = db_name; } - public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ - put(TYPE, new FieldMetaData("type", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRING))); - }}); + public void unsetDb_name() { + this.db_name = null; + } - static { - FieldMetaData.addStructMetaDataMap(drop_type_args.class, metaDataMap); + // Returns true if field db_name is set (has been asigned a value) and false otherwise + public boolean isSetDb_name() { + return this.db_name != null; } - public drop_type_args() { + public String getTbl_name() { + return this.tbl_name; } - public drop_type_args( - String type) - { - this(); - this.type = type; + public void setTbl_name(String tbl_name) { + this.tbl_name = tbl_name; } - /** - * Performs a deep copy on other. - */ - public drop_type_args(drop_type_args other) { - if (other.isSetType()) { - this.type = other.type; - } + public void unsetTbl_name() { + this.tbl_name = null; } - @Override - public drop_type_args clone() { - return new drop_type_args(this); + // Returns true if field tbl_name is set (has been asigned a value) and false otherwise + public boolean isSetTbl_name() { + return this.tbl_name != null; } - public String getType() { - return this.type; + public short getMax_parts() { + return this.max_parts; } - public void setType(String type) { - this.type = type; + public void setMax_parts(short max_parts) { + this.max_parts = max_parts; + this.__isset.max_parts = true; } - public void unsetType() { - this.type = null; + public void unsetMax_parts() { + this.__isset.max_parts = false; } - // Returns true if field type is set (has been asigned a value) and false otherwise - public boolean isSetType() { - return this.type != null; + // Returns true if field max_parts is set (has been asigned a value) and false otherwise + public boolean isSetMax_parts() { + return this.__isset.max_parts; } public void setFieldValue(int fieldID, Object value) { switch (fieldID) { - case TYPE: + case DB_NAME: if (value == null) { - unsetType(); + unsetDb_name(); } else { - setType((String)value); + setDb_name((String)value); + } + break; + + case TBL_NAME: + if (value == null) { + unsetTbl_name(); + } else { + setTbl_name((String)value); + } + break; + + case MAX_PARTS: + if (value == null) { + unsetMax_parts(); + } else { + setMax_parts((Short)value); } break; @@ -6542,8 +19219,14 @@ public Object getFieldValue(int fieldID) { switch (fieldID) { - case TYPE: - return getType(); + case DB_NAME: + return getDb_name(); + + case TBL_NAME: + return getTbl_name(); + + case MAX_PARTS: + return new Short(getMax_parts()); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); @@ -6553,8 +19236,12 @@ // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise public boolean isSet(int fieldID) { switch (fieldID) { - case TYPE: - return isSetType(); + case DB_NAME: + return isSetDb_name(); + case TBL_NAME: + return isSetTbl_name(); + case MAX_PARTS: + return isSetMax_parts(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -6564,21 +19251,39 @@ public boolean equals(Object that) { if (that == null) return false; - if (that instanceof drop_type_args) - return this.equals((drop_type_args)that); + if (that instanceof get_partition_names_args) + return this.equals((get_partition_names_args)that); return false; } - public boolean equals(drop_type_args that) { + public boolean equals(get_partition_names_args that) { if (that == null) return false; - boolean this_present_type = true && this.isSetType(); - boolean that_present_type = true && that.isSetType(); - if (this_present_type || that_present_type) { - if (!(this_present_type && that_present_type)) + 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) { + if (!(this_present_db_name && that_present_db_name)) return false; - if (!this.type.equals(that.type)) + if (!this.db_name.equals(that.db_name)) + return false; + } + + boolean this_present_tbl_name = true && this.isSetTbl_name(); + boolean that_present_tbl_name = true && that.isSetTbl_name(); + if (this_present_tbl_name || that_present_tbl_name) { + if (!(this_present_tbl_name && that_present_tbl_name)) + return false; + if (!this.tbl_name.equals(that.tbl_name)) + return false; + } + + boolean this_present_max_parts = true; + boolean that_present_max_parts = true; + if (this_present_max_parts || that_present_max_parts) { + if (!(this_present_max_parts && that_present_max_parts)) + return false; + if (this.max_parts != that.max_parts) return false; } @@ -6601,9 +19306,24 @@ } switch (field.id) { - case TYPE: + case DB_NAME: if (field.type == TType.STRING) { - this.type = iprot.readString(); + this.db_name = iprot.readString(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case TBL_NAME: + if (field.type == TType.STRING) { + this.tbl_name = iprot.readString(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case MAX_PARTS: + if (field.type == TType.I16) { + this.max_parts = iprot.readI16(); + this.__isset.max_parts = true; } else { TProtocolUtil.skip(iprot, field.type); } @@ -6623,27 +19343,47 @@ validate(); oprot.writeStructBegin(STRUCT_DESC); - if (this.type != null) { - oprot.writeFieldBegin(TYPE_FIELD_DESC); - oprot.writeString(this.type); + if (this.db_name != null) { + oprot.writeFieldBegin(DB_NAME_FIELD_DESC); + oprot.writeString(this.db_name); + oprot.writeFieldEnd(); + } + if (this.tbl_name != null) { + oprot.writeFieldBegin(TBL_NAME_FIELD_DESC); + oprot.writeString(this.tbl_name); oprot.writeFieldEnd(); } + oprot.writeFieldBegin(MAX_PARTS_FIELD_DESC); + oprot.writeI16(this.max_parts); + oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } @Override public String toString() { - StringBuilder sb = new StringBuilder("drop_type_args("); + StringBuilder sb = new StringBuilder("get_partition_names_args("); boolean first = true; - sb.append("type:"); - if (this.type == null) { + sb.append("db_name:"); + if (this.db_name == null) { sb.append("null"); } else { - sb.append(this.type); + sb.append(this.db_name); + } + first = false; + if (!first) sb.append(", "); + sb.append("tbl_name:"); + if (this.tbl_name == null) { + sb.append("null"); + } else { + sb.append(this.tbl_name); } first = false; + if (!first) sb.append(", "); + sb.append("max_parts:"); + sb.append(this.max_parts); + first = false; sb.append(")"); return sb.toString(); } @@ -6655,111 +19395,102 @@ } - public static class drop_type_result implements TBase, java.io.Serializable, Cloneable { - private static final TStruct STRUCT_DESC = new TStruct("drop_type_result"); - private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.BOOL, (short)0); - private static final TField O1_FIELD_DESC = new TField("o1", TType.STRUCT, (short)1); - private static final TField O2_FIELD_DESC = new TField("o2", TType.STRUCT, (short)2); + public static class get_partition_names_result implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("get_partition_names_result"); + private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.LIST, (short)0); + private static final TField O2_FIELD_DESC = new TField("o2", TType.STRUCT, (short)1); - private boolean success; + private List success; public static final int SUCCESS = 0; - private MetaException o1; - public static final int O1 = 1; - private NoSuchObjectException o2; - public static final int O2 = 2; + private MetaException o2; + public static final int O2 = 1; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { - public boolean success = false; } public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ put(SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.BOOL))); - put(O1, new FieldMetaData("o1", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRUCT))); + new ListMetaData(TType.LIST, + new FieldValueMetaData(TType.STRING)))); put(O2, new FieldMetaData("o2", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRUCT))); }}); static { - FieldMetaData.addStructMetaDataMap(drop_type_result.class, metaDataMap); + FieldMetaData.addStructMetaDataMap(get_partition_names_result.class, metaDataMap); } - public drop_type_result() { + public get_partition_names_result() { } - public drop_type_result( - boolean success, - MetaException o1, - NoSuchObjectException o2) + public get_partition_names_result( + List success, + MetaException o2) { this(); this.success = success; - this.__isset.success = true; - this.o1 = o1; this.o2 = o2; } /** * Performs a deep copy on other. */ - public drop_type_result(drop_type_result other) { - __isset.success = other.__isset.success; - this.success = other.success; - if (other.isSetO1()) { - this.o1 = new MetaException(other.o1); + public get_partition_names_result(get_partition_names_result other) { + if (other.isSetSuccess()) { + List __this__success = new ArrayList(); + for (String other_element : other.success) { + __this__success.add(other_element); + } + this.success = __this__success; } if (other.isSetO2()) { - this.o2 = new NoSuchObjectException(other.o2); + this.o2 = new MetaException(other.o2); } } @Override - public drop_type_result clone() { - return new drop_type_result(this); - } - - public boolean isSuccess() { - return this.success; + public get_partition_names_result clone() { + return new get_partition_names_result(this); } - public void setSuccess(boolean success) { - this.success = success; - this.__isset.success = true; + public int getSuccessSize() { + return (this.success == null) ? 0 : this.success.size(); } - public void unsetSuccess() { - this.__isset.success = false; + public java.util.Iterator getSuccessIterator() { + return (this.success == null) ? null : this.success.iterator(); } - // Returns true if field success is set (has been asigned a value) and false otherwise - public boolean isSetSuccess() { - return this.__isset.success; + public void addToSuccess(String elem) { + if (this.success == null) { + this.success = new ArrayList(); + } + this.success.add(elem); } - public MetaException getO1() { - return this.o1; + public List getSuccess() { + return this.success; } - public void setO1(MetaException o1) { - this.o1 = o1; + public void setSuccess(List success) { + this.success = success; } - public void unsetO1() { - this.o1 = null; + public void unsetSuccess() { + this.success = null; } - // Returns true if field o1 is set (has been asigned a value) and false otherwise - public boolean isSetO1() { - return this.o1 != null; + // Returns true if field success is set (has been asigned a value) and false otherwise + public boolean isSetSuccess() { + return this.success != null; } - public NoSuchObjectException getO2() { + public MetaException getO2() { return this.o2; } - public void setO2(NoSuchObjectException o2) { + public void setO2(MetaException o2) { this.o2 = o2; } @@ -6778,15 +19509,7 @@ if (value == null) { unsetSuccess(); } else { - setSuccess((Boolean)value); - } - break; - - case O1: - if (value == null) { - unsetO1(); - } else { - setO1((MetaException)value); + setSuccess((List)value); } break; @@ -6794,7 +19517,7 @@ if (value == null) { unsetO2(); } else { - setO2((NoSuchObjectException)value); + setO2((MetaException)value); } break; @@ -6806,10 +19529,7 @@ public Object getFieldValue(int fieldID) { switch (fieldID) { case SUCCESS: - return new Boolean(isSuccess()); - - case O1: - return getO1(); + return getSuccess(); case O2: return getO2(); @@ -6824,8 +19544,6 @@ switch (fieldID) { case SUCCESS: return isSetSuccess(); - case O1: - return isSetO1(); case O2: return isSetO2(); default: @@ -6837,30 +19555,21 @@ public boolean equals(Object that) { if (that == null) return false; - if (that instanceof drop_type_result) - return this.equals((drop_type_result)that); + if (that instanceof get_partition_names_result) + return this.equals((get_partition_names_result)that); return false; } - public boolean equals(drop_type_result that) { + public boolean equals(get_partition_names_result that) { if (that == null) return false; - boolean this_present_success = true; - boolean that_present_success = true; + boolean this_present_success = true && this.isSetSuccess(); + boolean that_present_success = true && that.isSetSuccess(); if (this_present_success || that_present_success) { if (!(this_present_success && that_present_success)) return false; - if (this.success != that.success) - return false; - } - - boolean this_present_o1 = true && this.isSetO1(); - boolean that_present_o1 = true && that.isSetO1(); - if (this_present_o1 || that_present_o1) { - if (!(this_present_o1 && that_present_o1)) - return false; - if (!this.o1.equals(that.o1)) + if (!this.success.equals(that.success)) return false; } @@ -6893,24 +19602,25 @@ switch (field.id) { case SUCCESS: - if (field.type == TType.BOOL) { - this.success = iprot.readBool(); - this.__isset.success = true; - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - case O1: - if (field.type == TType.STRUCT) { - this.o1 = new MetaException(); - this.o1.read(iprot); + if (field.type == TType.LIST) { + { + TList _list142 = iprot.readListBegin(); + this.success = new ArrayList(_list142.size); + for (int _i143 = 0; _i143 < _list142.size; ++_i143) + { + String _elem144; + _elem144 = iprot.readString(); + this.success.add(_elem144); + } + iprot.readListEnd(); + } } else { TProtocolUtil.skip(iprot, field.type); } break; case O2: if (field.type == TType.STRUCT) { - this.o2 = new NoSuchObjectException(); + this.o2 = new MetaException(); this.o2.read(iprot); } else { TProtocolUtil.skip(iprot, field.type); @@ -6932,11 +19642,13 @@ if (this.isSetSuccess()) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - oprot.writeBool(this.success); - oprot.writeFieldEnd(); - } else if (this.isSetO1()) { - oprot.writeFieldBegin(O1_FIELD_DESC); - this.o1.write(oprot); + { + oprot.writeListBegin(new TList(TType.STRING, this.success.size())); + for (String _iter145 : this.success) { + oprot.writeString(_iter145); + } + oprot.writeListEnd(); + } oprot.writeFieldEnd(); } else if (this.isSetO2()) { oprot.writeFieldBegin(O2_FIELD_DESC); @@ -6949,18 +19661,14 @@ @Override public String toString() { - StringBuilder sb = new StringBuilder("drop_type_result("); + StringBuilder sb = new StringBuilder("get_partition_names_result("); boolean first = true; sb.append("success:"); - sb.append(this.success); - first = false; - if (!first) sb.append(", "); - sb.append("o1:"); - if (this.o1 == null) { + if (this.success == null) { sb.append("null"); } else { - sb.append(this.o1); + sb.append(this.success); } first = false; if (!first) sb.append(", "); @@ -6982,74 +19690,203 @@ } - public static class get_type_all_args implements TBase, java.io.Serializable, Cloneable { - private static final TStruct STRUCT_DESC = new TStruct("get_type_all_args"); - private static final TField NAME_FIELD_DESC = new TField("name", TType.STRING, (short)1); + public static class get_partitions_ps_args implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("get_partitions_ps_args"); + private static final TField DB_NAME_FIELD_DESC = new TField("db_name", TType.STRING, (short)1); + private static final TField TBL_NAME_FIELD_DESC = new TField("tbl_name", TType.STRING, (short)2); + private static final TField PART_VALS_FIELD_DESC = new TField("part_vals", TType.LIST, (short)3); + private static final TField MAX_PARTS_FIELD_DESC = new TField("max_parts", TType.I16, (short)4); - private String name; - public static final int NAME = 1; + private String db_name; + public static final int DB_NAME = 1; + private String tbl_name; + public static final int TBL_NAME = 2; + private List part_vals; + public static final int PART_VALS = 3; + private short max_parts; + public static final int MAX_PARTS = 4; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { + public boolean max_parts = false; } public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ - put(NAME, new FieldMetaData("name", TFieldRequirementType.DEFAULT, + put(DB_NAME, new FieldMetaData("db_name", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + put(TBL_NAME, new FieldMetaData("tbl_name", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRING))); + put(PART_VALS, new FieldMetaData("part_vals", TFieldRequirementType.DEFAULT, + new ListMetaData(TType.LIST, + new FieldValueMetaData(TType.STRING)))); + put(MAX_PARTS, new FieldMetaData("max_parts", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.I16))); }}); static { - FieldMetaData.addStructMetaDataMap(get_type_all_args.class, metaDataMap); + FieldMetaData.addStructMetaDataMap(get_partitions_ps_args.class, metaDataMap); + } + + public get_partitions_ps_args() { + this.max_parts = (short)-1; + + } + + public get_partitions_ps_args( + String db_name, + String tbl_name, + List part_vals, + short max_parts) + { + this(); + this.db_name = db_name; + this.tbl_name = tbl_name; + this.part_vals = part_vals; + this.max_parts = max_parts; + this.__isset.max_parts = true; + } + + /** + * Performs a deep copy on other. + */ + public get_partitions_ps_args(get_partitions_ps_args other) { + if (other.isSetDb_name()) { + this.db_name = other.db_name; + } + if (other.isSetTbl_name()) { + this.tbl_name = other.tbl_name; + } + if (other.isSetPart_vals()) { + List __this__part_vals = new ArrayList(); + for (String other_element : other.part_vals) { + __this__part_vals.add(other_element); + } + this.part_vals = __this__part_vals; + } + __isset.max_parts = other.__isset.max_parts; + this.max_parts = other.max_parts; + } + + @Override + public get_partitions_ps_args clone() { + return new get_partitions_ps_args(this); + } + + public String getDb_name() { + return this.db_name; + } + + public void setDb_name(String db_name) { + this.db_name = db_name; + } + + public void unsetDb_name() { + this.db_name = null; + } + + // Returns true if field db_name is set (has been asigned a value) and false otherwise + public boolean isSetDb_name() { + return this.db_name != null; + } + + public String getTbl_name() { + return this.tbl_name; + } + + public void setTbl_name(String tbl_name) { + this.tbl_name = tbl_name; + } + + public void unsetTbl_name() { + this.tbl_name = null; + } + + // Returns true if field tbl_name is set (has been asigned a value) and false otherwise + public boolean isSetTbl_name() { + return this.tbl_name != null; + } + + public int getPart_valsSize() { + return (this.part_vals == null) ? 0 : this.part_vals.size(); + } + + public java.util.Iterator getPart_valsIterator() { + return (this.part_vals == null) ? null : this.part_vals.iterator(); + } + + public void addToPart_vals(String elem) { + if (this.part_vals == null) { + this.part_vals = new ArrayList(); + } + this.part_vals.add(elem); } - public get_type_all_args() { + public List getPart_vals() { + return this.part_vals; } - public get_type_all_args( - String name) - { - this(); - this.name = name; + public void setPart_vals(List part_vals) { + this.part_vals = part_vals; } - /** - * Performs a deep copy on other. - */ - public get_type_all_args(get_type_all_args other) { - if (other.isSetName()) { - this.name = other.name; - } + public void unsetPart_vals() { + this.part_vals = null; } - @Override - public get_type_all_args clone() { - return new get_type_all_args(this); + // Returns true if field part_vals is set (has been asigned a value) and false otherwise + public boolean isSetPart_vals() { + return this.part_vals != null; } - public String getName() { - return this.name; + public short getMax_parts() { + return this.max_parts; } - public void setName(String name) { - this.name = name; + public void setMax_parts(short max_parts) { + this.max_parts = max_parts; + this.__isset.max_parts = true; } - public void unsetName() { - this.name = null; + public void unsetMax_parts() { + this.__isset.max_parts = false; } - // Returns true if field name is set (has been asigned a value) and false otherwise - public boolean isSetName() { - return this.name != null; + // Returns true if field max_parts is set (has been asigned a value) and false otherwise + public boolean isSetMax_parts() { + return this.__isset.max_parts; } public void setFieldValue(int fieldID, Object value) { switch (fieldID) { - case NAME: + case DB_NAME: if (value == null) { - unsetName(); + unsetDb_name(); } else { - setName((String)value); + setDb_name((String)value); + } + break; + + case TBL_NAME: + if (value == null) { + unsetTbl_name(); + } else { + setTbl_name((String)value); + } + break; + + case PART_VALS: + if (value == null) { + unsetPart_vals(); + } else { + setPart_vals((List)value); + } + break; + + case MAX_PARTS: + if (value == null) { + unsetMax_parts(); + } else { + setMax_parts((Short)value); } break; @@ -7060,8 +19897,17 @@ public Object getFieldValue(int fieldID) { switch (fieldID) { - case NAME: - return getName(); + case DB_NAME: + return getDb_name(); + + case TBL_NAME: + return getTbl_name(); + + case PART_VALS: + return getPart_vals(); + + case MAX_PARTS: + return new Short(getMax_parts()); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); @@ -7071,8 +19917,14 @@ // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise public boolean isSet(int fieldID) { switch (fieldID) { - case NAME: - return isSetName(); + case DB_NAME: + return isSetDb_name(); + case TBL_NAME: + return isSetTbl_name(); + case PART_VALS: + return isSetPart_vals(); + case MAX_PARTS: + return isSetMax_parts(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -7082,21 +19934,48 @@ public boolean equals(Object that) { if (that == null) return false; - if (that instanceof get_type_all_args) - return this.equals((get_type_all_args)that); + if (that instanceof get_partitions_ps_args) + return this.equals((get_partitions_ps_args)that); return false; } - public boolean equals(get_type_all_args that) { + public boolean equals(get_partitions_ps_args 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)) + 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) { + if (!(this_present_db_name && that_present_db_name)) return false; - if (!this.name.equals(that.name)) + if (!this.db_name.equals(that.db_name)) + return false; + } + + boolean this_present_tbl_name = true && this.isSetTbl_name(); + boolean that_present_tbl_name = true && that.isSetTbl_name(); + if (this_present_tbl_name || that_present_tbl_name) { + if (!(this_present_tbl_name && that_present_tbl_name)) + return false; + if (!this.tbl_name.equals(that.tbl_name)) + return false; + } + + boolean this_present_part_vals = true && this.isSetPart_vals(); + boolean that_present_part_vals = true && that.isSetPart_vals(); + if (this_present_part_vals || that_present_part_vals) { + if (!(this_present_part_vals && that_present_part_vals)) + return false; + if (!this.part_vals.equals(that.part_vals)) + return false; + } + + boolean this_present_max_parts = true; + boolean that_present_max_parts = true; + if (this_present_max_parts || that_present_max_parts) { + if (!(this_present_max_parts && that_present_max_parts)) + return false; + if (this.max_parts != that.max_parts) return false; } @@ -7119,9 +19998,41 @@ } switch (field.id) { - case NAME: + case DB_NAME: if (field.type == TType.STRING) { - this.name = iprot.readString(); + this.db_name = iprot.readString(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case TBL_NAME: + if (field.type == TType.STRING) { + this.tbl_name = iprot.readString(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case PART_VALS: + if (field.type == TType.LIST) { + { + TList _list146 = iprot.readListBegin(); + this.part_vals = new ArrayList(_list146.size); + for (int _i147 = 0; _i147 < _list146.size; ++_i147) + { + String _elem148; + _elem148 = iprot.readString(); + this.part_vals.add(_elem148); + } + iprot.readListEnd(); + } + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case MAX_PARTS: + if (field.type == TType.I16) { + this.max_parts = iprot.readI16(); + this.__isset.max_parts = true; } else { TProtocolUtil.skip(iprot, field.type); } @@ -7141,27 +20052,66 @@ validate(); oprot.writeStructBegin(STRUCT_DESC); - if (this.name != null) { - oprot.writeFieldBegin(NAME_FIELD_DESC); - oprot.writeString(this.name); + if (this.db_name != null) { + oprot.writeFieldBegin(DB_NAME_FIELD_DESC); + oprot.writeString(this.db_name); + oprot.writeFieldEnd(); + } + if (this.tbl_name != null) { + oprot.writeFieldBegin(TBL_NAME_FIELD_DESC); + oprot.writeString(this.tbl_name); + oprot.writeFieldEnd(); + } + if (this.part_vals != null) { + oprot.writeFieldBegin(PART_VALS_FIELD_DESC); + { + oprot.writeListBegin(new TList(TType.STRING, this.part_vals.size())); + for (String _iter149 : this.part_vals) { + oprot.writeString(_iter149); + } + oprot.writeListEnd(); + } oprot.writeFieldEnd(); } + oprot.writeFieldBegin(MAX_PARTS_FIELD_DESC); + oprot.writeI16(this.max_parts); + oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } @Override public String toString() { - StringBuilder sb = new StringBuilder("get_type_all_args("); + StringBuilder sb = new StringBuilder("get_partitions_ps_args("); boolean first = true; - sb.append("name:"); - if (this.name == null) { + sb.append("db_name:"); + if (this.db_name == null) { sb.append("null"); } else { - sb.append(this.name); + sb.append(this.db_name); + } + first = false; + if (!first) sb.append(", "); + sb.append("tbl_name:"); + if (this.tbl_name == null) { + sb.append("null"); + } else { + sb.append(this.tbl_name); + } + first = false; + if (!first) sb.append(", "); + sb.append("part_vals:"); + if (this.part_vals == null) { + sb.append("null"); + } else { + sb.append(this.part_vals); } first = false; + if (!first) sb.append(", "); + sb.append("max_parts:"); + sb.append(this.max_parts); + first = false; sb.append(")"); return sb.toString(); } @@ -7173,15 +20123,15 @@ } - public static class get_type_all_result implements TBase, java.io.Serializable, Cloneable { - private static final TStruct STRUCT_DESC = new TStruct("get_type_all_result"); - private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.MAP, (short)0); - private static final TField O2_FIELD_DESC = new TField("o2", TType.STRUCT, (short)1); + public static class get_partitions_ps_result implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("get_partitions_ps_result"); + private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.LIST, (short)0); + private static final TField O1_FIELD_DESC = new TField("o1", TType.STRUCT, (short)1); - private Map success; + private List success; public static final int SUCCESS = 0; - private MetaException o2; - public static final int O2 = 1; + private MetaException o1; + public static final int O1 = 1; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { @@ -7189,74 +20139,69 @@ public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ put(SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, - new MapMetaData(TType.MAP, - new FieldValueMetaData(TType.STRING), - new StructMetaData(TType.STRUCT, Type.class)))); - put(O2, new FieldMetaData("o2", TFieldRequirementType.DEFAULT, + new ListMetaData(TType.LIST, + new StructMetaData(TType.STRUCT, Partition.class)))); + put(O1, new FieldMetaData("o1", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRUCT))); }}); static { - FieldMetaData.addStructMetaDataMap(get_type_all_result.class, metaDataMap); + FieldMetaData.addStructMetaDataMap(get_partitions_ps_result.class, metaDataMap); } - public get_type_all_result() { + public get_partitions_ps_result() { } - public get_type_all_result( - Map success, - MetaException o2) + public get_partitions_ps_result( + List success, + MetaException o1) { this(); this.success = success; - this.o2 = o2; + this.o1 = o1; } /** * Performs a deep copy on other. */ - public get_type_all_result(get_type_all_result other) { + public get_partitions_ps_result(get_partitions_ps_result other) { if (other.isSetSuccess()) { - Map __this__success = new HashMap(); - for (Map.Entry other_element : other.success.entrySet()) { - - String other_element_key = other_element.getKey(); - Type other_element_value = other_element.getValue(); - - String __this__success_copy_key = other_element_key; - - Type __this__success_copy_value = new Type(other_element_value); - - __this__success.put(__this__success_copy_key, __this__success_copy_value); + List __this__success = new ArrayList(); + for (Partition other_element : other.success) { + __this__success.add(new Partition(other_element)); } this.success = __this__success; } - if (other.isSetO2()) { - this.o2 = new MetaException(other.o2); + if (other.isSetO1()) { + this.o1 = new MetaException(other.o1); } } @Override - public get_type_all_result clone() { - return new get_type_all_result(this); + public get_partitions_ps_result clone() { + return new get_partitions_ps_result(this); } public int getSuccessSize() { return (this.success == null) ? 0 : this.success.size(); } - public void putToSuccess(String key, Type val) { + public java.util.Iterator getSuccessIterator() { + return (this.success == null) ? null : this.success.iterator(); + } + + public void addToSuccess(Partition elem) { if (this.success == null) { - this.success = new HashMap(); + this.success = new ArrayList(); } - this.success.put(key, val); + this.success.add(elem); } - public Map getSuccess() { + public List getSuccess() { return this.success; } - public void setSuccess(Map success) { + public void setSuccess(List success) { this.success = success; } @@ -7269,21 +20214,21 @@ return this.success != null; } - public MetaException getO2() { - return this.o2; + public MetaException getO1() { + return this.o1; } - public void setO2(MetaException o2) { - this.o2 = o2; + public void setO1(MetaException o1) { + this.o1 = o1; } - public void unsetO2() { - this.o2 = null; + public void unsetO1() { + this.o1 = null; } - // Returns true if field o2 is set (has been asigned a value) and false otherwise - public boolean isSetO2() { - return this.o2 != null; + // Returns true if field o1 is set (has been asigned a value) and false otherwise + public boolean isSetO1() { + return this.o1 != null; } public void setFieldValue(int fieldID, Object value) { @@ -7292,15 +20237,15 @@ if (value == null) { unsetSuccess(); } else { - setSuccess((Map)value); + setSuccess((List)value); } break; - case O2: + case O1: if (value == null) { - unsetO2(); + unsetO1(); } else { - setO2((MetaException)value); + setO1((MetaException)value); } break; @@ -7314,8 +20259,8 @@ case SUCCESS: return getSuccess(); - case O2: - return getO2(); + case O1: + return getO1(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); @@ -7327,8 +20272,8 @@ switch (fieldID) { case SUCCESS: return isSetSuccess(); - case O2: - return isSetO2(); + case O1: + return isSetO1(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -7338,12 +20283,12 @@ public boolean equals(Object that) { if (that == null) return false; - if (that instanceof get_type_all_result) - return this.equals((get_type_all_result)that); + if (that instanceof get_partitions_ps_result) + return this.equals((get_partitions_ps_result)that); return false; } - public boolean equals(get_type_all_result that) { + public boolean equals(get_partitions_ps_result that) { if (that == null) return false; @@ -7356,12 +20301,12 @@ return false; } - boolean this_present_o2 = true && this.isSetO2(); - boolean that_present_o2 = true && that.isSetO2(); - if (this_present_o2 || that_present_o2) { - if (!(this_present_o2 && that_present_o2)) + boolean this_present_o1 = true && this.isSetO1(); + boolean that_present_o1 = true && that.isSetO1(); + if (this_present_o1 || that_present_o1) { + if (!(this_present_o1 && that_present_o1)) return false; - if (!this.o2.equals(that.o2)) + if (!this.o1.equals(that.o1)) return false; } @@ -7385,29 +20330,27 @@ switch (field.id) { case SUCCESS: - if (field.type == TType.MAP) { + if (field.type == TType.LIST) { { - TMap _map66 = iprot.readMapBegin(); - this.success = new HashMap(2*_map66.size); - for (int _i67 = 0; _i67 < _map66.size; ++_i67) + TList _list150 = iprot.readListBegin(); + this.success = new ArrayList(_list150.size); + for (int _i151 = 0; _i151 < _list150.size; ++_i151) { - String _key68; - Type _val69; - _key68 = iprot.readString(); - _val69 = new Type(); - _val69.read(iprot); - this.success.put(_key68, _val69); + Partition _elem152; + _elem152 = new Partition(); + _elem152.read(iprot); + this.success.add(_elem152); } - iprot.readMapEnd(); + iprot.readListEnd(); } } else { TProtocolUtil.skip(iprot, field.type); } break; - case O2: + case O1: if (field.type == TType.STRUCT) { - this.o2 = new MetaException(); - this.o2.read(iprot); + this.o1 = new MetaException(); + this.o1.read(iprot); } else { TProtocolUtil.skip(iprot, field.type); } @@ -7429,17 +20372,16 @@ if (this.isSetSuccess()) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { - oprot.writeMapBegin(new TMap(TType.STRING, TType.STRUCT, this.success.size())); - for (Map.Entry _iter70 : this.success.entrySet()) { - oprot.writeString(_iter70.getKey()); - _iter70.getValue().write(oprot); + oprot.writeListBegin(new TList(TType.STRUCT, this.success.size())); + for (Partition _iter153 : this.success) { + _iter153.write(oprot); } - oprot.writeMapEnd(); + oprot.writeListEnd(); } oprot.writeFieldEnd(); - } else if (this.isSetO2()) { - oprot.writeFieldBegin(O2_FIELD_DESC); - this.o2.write(oprot); + } else if (this.isSetO1()) { + oprot.writeFieldBegin(O1_FIELD_DESC); + this.o1.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); @@ -7448,7 +20390,7 @@ @Override public String toString() { - StringBuilder sb = new StringBuilder("get_type_all_result("); + StringBuilder sb = new StringBuilder("get_partitions_ps_result("); boolean first = true; sb.append("success:"); @@ -7459,11 +20401,11 @@ } first = false; if (!first) sb.append(", "); - sb.append("o2:"); - if (this.o2 == null) { + sb.append("o1:"); + if (this.o1 == null) { sb.append("null"); } else { - sb.append(this.o2); + sb.append(this.o1); } first = false; sb.append(")"); @@ -7477,58 +20419,86 @@ } - public static class get_fields_args implements TBase, java.io.Serializable, Cloneable { - private static final TStruct STRUCT_DESC = new TStruct("get_fields_args"); + public static class get_partition_names_ps_args implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("get_partition_names_ps_args"); private static final TField DB_NAME_FIELD_DESC = new TField("db_name", TType.STRING, (short)1); - private static final TField TABLE_NAME_FIELD_DESC = new TField("table_name", TType.STRING, (short)2); + private static final TField TBL_NAME_FIELD_DESC = new TField("tbl_name", TType.STRING, (short)2); + private static final TField PART_VALS_FIELD_DESC = new TField("part_vals", TType.LIST, (short)3); + private static final TField MAX_PARTS_FIELD_DESC = new TField("max_parts", TType.I16, (short)4); private String db_name; public static final int DB_NAME = 1; - private String table_name; - public static final int TABLE_NAME = 2; + private String tbl_name; + public static final int TBL_NAME = 2; + private List part_vals; + public static final int PART_VALS = 3; + private short max_parts; + public static final int MAX_PARTS = 4; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { + public boolean max_parts = false; } public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ put(DB_NAME, new FieldMetaData("db_name", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRING))); - put(TABLE_NAME, new FieldMetaData("table_name", TFieldRequirementType.DEFAULT, + put(TBL_NAME, new FieldMetaData("tbl_name", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRING))); + put(PART_VALS, new FieldMetaData("part_vals", TFieldRequirementType.DEFAULT, + new ListMetaData(TType.LIST, + new FieldValueMetaData(TType.STRING)))); + put(MAX_PARTS, new FieldMetaData("max_parts", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.I16))); }}); static { - FieldMetaData.addStructMetaDataMap(get_fields_args.class, metaDataMap); + FieldMetaData.addStructMetaDataMap(get_partition_names_ps_args.class, metaDataMap); } - public get_fields_args() { + public get_partition_names_ps_args() { + this.max_parts = (short)-1; + } - public get_fields_args( + public get_partition_names_ps_args( String db_name, - String table_name) + String tbl_name, + List part_vals, + short max_parts) { this(); this.db_name = db_name; - this.table_name = table_name; + this.tbl_name = tbl_name; + this.part_vals = part_vals; + this.max_parts = max_parts; + this.__isset.max_parts = true; } /** * Performs a deep copy on other. */ - public get_fields_args(get_fields_args other) { + public get_partition_names_ps_args(get_partition_names_ps_args other) { if (other.isSetDb_name()) { this.db_name = other.db_name; } - if (other.isSetTable_name()) { - this.table_name = other.table_name; + if (other.isSetTbl_name()) { + this.tbl_name = other.tbl_name; + } + if (other.isSetPart_vals()) { + List __this__part_vals = new ArrayList(); + for (String other_element : other.part_vals) { + __this__part_vals.add(other_element); + } + this.part_vals = __this__part_vals; } + __isset.max_parts = other.__isset.max_parts; + this.max_parts = other.max_parts; } @Override - public get_fields_args clone() { - return new get_fields_args(this); + public get_partition_names_ps_args clone() { + return new get_partition_names_ps_args(this); } public String getDb_name() { @@ -7548,21 +20518,71 @@ return this.db_name != null; } - public String getTable_name() { - return this.table_name; + public String getTbl_name() { + return this.tbl_name; + } + + public void setTbl_name(String tbl_name) { + this.tbl_name = tbl_name; + } + + public void unsetTbl_name() { + this.tbl_name = null; + } + + // Returns true if field tbl_name is set (has been asigned a value) and false otherwise + public boolean isSetTbl_name() { + return this.tbl_name != null; + } + + public int getPart_valsSize() { + return (this.part_vals == null) ? 0 : this.part_vals.size(); + } + + public java.util.Iterator getPart_valsIterator() { + return (this.part_vals == null) ? null : this.part_vals.iterator(); + } + + public void addToPart_vals(String elem) { + if (this.part_vals == null) { + this.part_vals = new ArrayList(); + } + this.part_vals.add(elem); + } + + public List getPart_vals() { + return this.part_vals; + } + + public void setPart_vals(List part_vals) { + this.part_vals = part_vals; + } + + public void unsetPart_vals() { + this.part_vals = null; + } + + // Returns true if field part_vals is set (has been asigned a value) and false otherwise + public boolean isSetPart_vals() { + return this.part_vals != null; + } + + public short getMax_parts() { + return this.max_parts; } - public void setTable_name(String table_name) { - this.table_name = table_name; + public void setMax_parts(short max_parts) { + this.max_parts = max_parts; + this.__isset.max_parts = true; } - public void unsetTable_name() { - this.table_name = null; + public void unsetMax_parts() { + this.__isset.max_parts = false; } - // Returns true if field table_name is set (has been asigned a value) and false otherwise - public boolean isSetTable_name() { - return this.table_name != null; + // Returns true if field max_parts is set (has been asigned a value) and false otherwise + public boolean isSetMax_parts() { + return this.__isset.max_parts; } public void setFieldValue(int fieldID, Object value) { @@ -7575,11 +20595,27 @@ } break; - case TABLE_NAME: + case TBL_NAME: if (value == null) { - unsetTable_name(); + unsetTbl_name(); } else { - setTable_name((String)value); + setTbl_name((String)value); + } + break; + + case PART_VALS: + if (value == null) { + unsetPart_vals(); + } else { + setPart_vals((List)value); + } + break; + + case MAX_PARTS: + if (value == null) { + unsetMax_parts(); + } else { + setMax_parts((Short)value); } break; @@ -7593,8 +20629,14 @@ case DB_NAME: return getDb_name(); - case TABLE_NAME: - return getTable_name(); + case TBL_NAME: + return getTbl_name(); + + case PART_VALS: + return getPart_vals(); + + case MAX_PARTS: + return new Short(getMax_parts()); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); @@ -7606,8 +20648,12 @@ switch (fieldID) { case DB_NAME: return isSetDb_name(); - case TABLE_NAME: - return isSetTable_name(); + case TBL_NAME: + return isSetTbl_name(); + case PART_VALS: + return isSetPart_vals(); + case MAX_PARTS: + return isSetMax_parts(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -7617,12 +20663,12 @@ public boolean equals(Object that) { if (that == null) return false; - if (that instanceof get_fields_args) - return this.equals((get_fields_args)that); + if (that instanceof get_partition_names_ps_args) + return this.equals((get_partition_names_ps_args)that); return false; } - public boolean equals(get_fields_args that) { + public boolean equals(get_partition_names_ps_args that) { if (that == null) return false; @@ -7635,12 +20681,30 @@ return false; } - boolean this_present_table_name = true && this.isSetTable_name(); - boolean that_present_table_name = true && that.isSetTable_name(); - if (this_present_table_name || that_present_table_name) { - if (!(this_present_table_name && that_present_table_name)) + boolean this_present_tbl_name = true && this.isSetTbl_name(); + boolean that_present_tbl_name = true && that.isSetTbl_name(); + if (this_present_tbl_name || that_present_tbl_name) { + if (!(this_present_tbl_name && that_present_tbl_name)) return false; - if (!this.table_name.equals(that.table_name)) + if (!this.tbl_name.equals(that.tbl_name)) + return false; + } + + boolean this_present_part_vals = true && this.isSetPart_vals(); + boolean that_present_part_vals = true && that.isSetPart_vals(); + if (this_present_part_vals || that_present_part_vals) { + if (!(this_present_part_vals && that_present_part_vals)) + return false; + if (!this.part_vals.equals(that.part_vals)) + return false; + } + + boolean this_present_max_parts = true; + boolean that_present_max_parts = true; + if (this_present_max_parts || that_present_max_parts) { + if (!(this_present_max_parts && that_present_max_parts)) + return false; + if (this.max_parts != that.max_parts) return false; } @@ -7670,9 +20734,34 @@ TProtocolUtil.skip(iprot, field.type); } break; - case TABLE_NAME: + case TBL_NAME: if (field.type == TType.STRING) { - this.table_name = iprot.readString(); + this.tbl_name = iprot.readString(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case PART_VALS: + if (field.type == TType.LIST) { + { + TList _list154 = iprot.readListBegin(); + this.part_vals = new ArrayList(_list154.size); + for (int _i155 = 0; _i155 < _list154.size; ++_i155) + { + String _elem156; + _elem156 = iprot.readString(); + this.part_vals.add(_elem156); + } + iprot.readListEnd(); + } + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case MAX_PARTS: + if (field.type == TType.I16) { + this.max_parts = iprot.readI16(); + this.__isset.max_parts = true; } else { TProtocolUtil.skip(iprot, field.type); } @@ -7697,18 +20786,32 @@ oprot.writeString(this.db_name); oprot.writeFieldEnd(); } - if (this.table_name != null) { - oprot.writeFieldBegin(TABLE_NAME_FIELD_DESC); - oprot.writeString(this.table_name); + if (this.tbl_name != null) { + oprot.writeFieldBegin(TBL_NAME_FIELD_DESC); + oprot.writeString(this.tbl_name); + oprot.writeFieldEnd(); + } + if (this.part_vals != null) { + oprot.writeFieldBegin(PART_VALS_FIELD_DESC); + { + oprot.writeListBegin(new TList(TType.STRING, this.part_vals.size())); + for (String _iter157 : this.part_vals) { + oprot.writeString(_iter157); + } + oprot.writeListEnd(); + } oprot.writeFieldEnd(); } + oprot.writeFieldBegin(MAX_PARTS_FIELD_DESC); + oprot.writeI16(this.max_parts); + oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } @Override public String toString() { - StringBuilder sb = new StringBuilder("get_fields_args("); + StringBuilder sb = new StringBuilder("get_partition_names_ps_args("); boolean first = true; sb.append("db_name:"); @@ -7719,13 +20822,25 @@ } first = false; if (!first) sb.append(", "); - sb.append("table_name:"); - if (this.table_name == null) { + sb.append("tbl_name:"); + if (this.tbl_name == null) { sb.append("null"); } else { - sb.append(this.table_name); + sb.append(this.tbl_name); + } + first = false; + if (!first) sb.append(", "); + sb.append("part_vals:"); + if (this.part_vals == null) { + sb.append("null"); + } else { + sb.append(this.part_vals); } first = false; + if (!first) sb.append(", "); + sb.append("max_parts:"); + sb.append(this.max_parts); + first = false; sb.append(")"); return sb.toString(); } @@ -7737,21 +20852,15 @@ } - public static class get_fields_result implements TBase, java.io.Serializable, Cloneable { - private static final TStruct STRUCT_DESC = new TStruct("get_fields_result"); + public static class get_partition_names_ps_result implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("get_partition_names_ps_result"); private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.LIST, (short)0); private static final TField O1_FIELD_DESC = new TField("o1", TType.STRUCT, (short)1); - private static final TField O2_FIELD_DESC = new TField("o2", TType.STRUCT, (short)2); - private static final TField O3_FIELD_DESC = new TField("o3", TType.STRUCT, (short)3); - private List success; + private List success; public static final int SUCCESS = 0; private MetaException o1; public static final int O1 = 1; - private UnknownTableException o2; - public static final int O2 = 2; - private UnknownDBException o3; - public static final int O3 = 3; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { @@ -7760,82 +20869,68 @@ public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ put(SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, new ListMetaData(TType.LIST, - new StructMetaData(TType.STRUCT, FieldSchema.class)))); + new FieldValueMetaData(TType.STRING)))); put(O1, new FieldMetaData("o1", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRUCT))); - put(O2, new FieldMetaData("o2", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRUCT))); - put(O3, new FieldMetaData("o3", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRUCT))); }}); static { - FieldMetaData.addStructMetaDataMap(get_fields_result.class, metaDataMap); + FieldMetaData.addStructMetaDataMap(get_partition_names_ps_result.class, metaDataMap); } - public get_fields_result() { + public get_partition_names_ps_result() { } - public get_fields_result( - List success, - MetaException o1, - UnknownTableException o2, - UnknownDBException o3) + public get_partition_names_ps_result( + List success, + MetaException o1) { this(); this.success = success; this.o1 = o1; - this.o2 = o2; - this.o3 = o3; } /** * Performs a deep copy on other. */ - public get_fields_result(get_fields_result other) { + public get_partition_names_ps_result(get_partition_names_ps_result other) { if (other.isSetSuccess()) { - List __this__success = new ArrayList(); - for (FieldSchema other_element : other.success) { - __this__success.add(new FieldSchema(other_element)); + List __this__success = new ArrayList(); + for (String other_element : other.success) { + __this__success.add(other_element); } this.success = __this__success; } if (other.isSetO1()) { this.o1 = new MetaException(other.o1); } - if (other.isSetO2()) { - this.o2 = new UnknownTableException(other.o2); - } - if (other.isSetO3()) { - this.o3 = new UnknownDBException(other.o3); - } } @Override - public get_fields_result clone() { - return new get_fields_result(this); + public get_partition_names_ps_result clone() { + return new get_partition_names_ps_result(this); } public int getSuccessSize() { return (this.success == null) ? 0 : this.success.size(); } - public java.util.Iterator getSuccessIterator() { + public java.util.Iterator getSuccessIterator() { return (this.success == null) ? null : this.success.iterator(); } - public void addToSuccess(FieldSchema elem) { + public void addToSuccess(String elem) { if (this.success == null) { - this.success = new ArrayList(); + this.success = new ArrayList(); } this.success.add(elem); } - public List getSuccess() { + public List getSuccess() { return this.success; } - public void setSuccess(List success) { + public void setSuccess(List success) { this.success = success; } @@ -7862,41 +20957,7 @@ // Returns true if field o1 is set (has been asigned a value) and false otherwise public boolean isSetO1() { - return this.o1 != null; - } - - public UnknownTableException getO2() { - return this.o2; - } - - public void setO2(UnknownTableException o2) { - this.o2 = o2; - } - - public void unsetO2() { - this.o2 = null; - } - - // Returns true if field o2 is set (has been asigned a value) and false otherwise - public boolean isSetO2() { - return this.o2 != null; - } - - public UnknownDBException getO3() { - return this.o3; - } - - public void setO3(UnknownDBException o3) { - this.o3 = o3; - } - - public void unsetO3() { - this.o3 = null; - } - - // Returns true if field o3 is set (has been asigned a value) and false otherwise - public boolean isSetO3() { - return this.o3 != null; + return this.o1 != null; } public void setFieldValue(int fieldID, Object value) { @@ -7905,7 +20966,7 @@ if (value == null) { unsetSuccess(); } else { - setSuccess((List)value); + setSuccess((List)value); } break; @@ -7917,22 +20978,6 @@ } break; - case O2: - if (value == null) { - unsetO2(); - } else { - setO2((UnknownTableException)value); - } - break; - - case O3: - if (value == null) { - unsetO3(); - } else { - setO3((UnknownDBException)value); - } - break; - default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -7946,12 +20991,6 @@ case O1: return getO1(); - case O2: - return getO2(); - - case O3: - return getO3(); - default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -7964,10 +21003,6 @@ return isSetSuccess(); case O1: return isSetO1(); - case O2: - return isSetO2(); - case O3: - return isSetO3(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -7977,12 +21012,12 @@ public boolean equals(Object that) { if (that == null) return false; - if (that instanceof get_fields_result) - return this.equals((get_fields_result)that); + if (that instanceof get_partition_names_ps_result) + return this.equals((get_partition_names_ps_result)that); return false; } - public boolean equals(get_fields_result that) { + public boolean equals(get_partition_names_ps_result that) { if (that == null) return false; @@ -8004,24 +21039,6 @@ return false; } - boolean this_present_o2 = true && this.isSetO2(); - boolean that_present_o2 = true && that.isSetO2(); - if (this_present_o2 || that_present_o2) { - if (!(this_present_o2 && that_present_o2)) - return false; - if (!this.o2.equals(that.o2)) - return false; - } - - boolean this_present_o3 = true && this.isSetO3(); - boolean that_present_o3 = true && that.isSetO3(); - if (this_present_o3 || that_present_o3) { - if (!(this_present_o3 && that_present_o3)) - return false; - if (!this.o3.equals(that.o3)) - return false; - } - return true; } @@ -8044,14 +21061,13 @@ case SUCCESS: if (field.type == TType.LIST) { { - TList _list71 = iprot.readListBegin(); - this.success = new ArrayList(_list71.size); - for (int _i72 = 0; _i72 < _list71.size; ++_i72) + TList _list158 = iprot.readListBegin(); + this.success = new ArrayList(_list158.size); + for (int _i159 = 0; _i159 < _list158.size; ++_i159) { - FieldSchema _elem73; - _elem73 = new FieldSchema(); - _elem73.read(iprot); - this.success.add(_elem73); + String _elem160; + _elem160 = iprot.readString(); + this.success.add(_elem160); } iprot.readListEnd(); } @@ -8067,22 +21083,6 @@ TProtocolUtil.skip(iprot, field.type); } break; - case O2: - if (field.type == TType.STRUCT) { - this.o2 = new UnknownTableException(); - this.o2.read(iprot); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - case O3: - if (field.type == TType.STRUCT) { - this.o3 = new UnknownDBException(); - this.o3.read(iprot); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; default: TProtocolUtil.skip(iprot, field.type); break; @@ -8100,9 +21100,9 @@ if (this.isSetSuccess()) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { - oprot.writeListBegin(new TList(TType.STRUCT, this.success.size())); - for (FieldSchema _iter74 : this.success) { - _iter74.write(oprot); + oprot.writeListBegin(new TList(TType.STRING, this.success.size())); + for (String _iter161 : this.success) { + oprot.writeString(_iter161); } oprot.writeListEnd(); } @@ -8111,14 +21111,6 @@ oprot.writeFieldBegin(O1_FIELD_DESC); this.o1.write(oprot); oprot.writeFieldEnd(); - } else if (this.isSetO2()) { - oprot.writeFieldBegin(O2_FIELD_DESC); - this.o2.write(oprot); - oprot.writeFieldEnd(); - } else if (this.isSetO3()) { - oprot.writeFieldBegin(O3_FIELD_DESC); - this.o3.write(oprot); - oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); @@ -8126,7 +21118,7 @@ @Override public String toString() { - StringBuilder sb = new StringBuilder("get_fields_result("); + StringBuilder sb = new StringBuilder("get_partition_names_ps_result("); boolean first = true; sb.append("success:"); @@ -8144,22 +21136,6 @@ sb.append(this.o1); } first = false; - if (!first) sb.append(", "); - sb.append("o2:"); - if (this.o2 == null) { - sb.append("null"); - } else { - sb.append(this.o2); - } - first = false; - if (!first) sb.append(", "); - sb.append("o3:"); - if (this.o3 == null) { - sb.append("null"); - } else { - sb.append(this.o3); - } - first = false; sb.append(")"); return sb.toString(); } @@ -8171,58 +21147,81 @@ } - public static class get_schema_args implements TBase, java.io.Serializable, Cloneable { - private static final TStruct STRUCT_DESC = new TStruct("get_schema_args"); + public static class get_partitions_by_filter_args implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("get_partitions_by_filter_args"); private static final TField DB_NAME_FIELD_DESC = new TField("db_name", TType.STRING, (short)1); - private static final TField TABLE_NAME_FIELD_DESC = new TField("table_name", TType.STRING, (short)2); + private static final TField TBL_NAME_FIELD_DESC = new TField("tbl_name", TType.STRING, (short)2); + private static final TField FILTER_FIELD_DESC = new TField("filter", TType.STRING, (short)3); + private static final TField MAX_PARTS_FIELD_DESC = new TField("max_parts", TType.I16, (short)4); private String db_name; public static final int DB_NAME = 1; - private String table_name; - public static final int TABLE_NAME = 2; + private String tbl_name; + public static final int TBL_NAME = 2; + private String filter; + public static final int FILTER = 3; + private short max_parts; + public static final int MAX_PARTS = 4; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { + public boolean max_parts = false; } public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ put(DB_NAME, new FieldMetaData("db_name", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRING))); - put(TABLE_NAME, new FieldMetaData("table_name", TFieldRequirementType.DEFAULT, + put(TBL_NAME, new FieldMetaData("tbl_name", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + put(FILTER, new FieldMetaData("filter", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRING))); + put(MAX_PARTS, new FieldMetaData("max_parts", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.I16))); }}); static { - FieldMetaData.addStructMetaDataMap(get_schema_args.class, metaDataMap); + FieldMetaData.addStructMetaDataMap(get_partitions_by_filter_args.class, metaDataMap); } - public get_schema_args() { + public get_partitions_by_filter_args() { + this.max_parts = (short)-1; + } - public get_schema_args( + public get_partitions_by_filter_args( String db_name, - String table_name) + String tbl_name, + String filter, + short max_parts) { this(); this.db_name = db_name; - this.table_name = table_name; + this.tbl_name = tbl_name; + this.filter = filter; + this.max_parts = max_parts; + this.__isset.max_parts = true; } /** * Performs a deep copy on other. */ - public get_schema_args(get_schema_args other) { + public get_partitions_by_filter_args(get_partitions_by_filter_args other) { if (other.isSetDb_name()) { this.db_name = other.db_name; } - if (other.isSetTable_name()) { - this.table_name = other.table_name; + if (other.isSetTbl_name()) { + this.tbl_name = other.tbl_name; + } + if (other.isSetFilter()) { + this.filter = other.filter; } + __isset.max_parts = other.__isset.max_parts; + this.max_parts = other.max_parts; } @Override - public get_schema_args clone() { - return new get_schema_args(this); + public get_partitions_by_filter_args clone() { + return new get_partitions_by_filter_args(this); } public String getDb_name() { @@ -8242,21 +21241,56 @@ return this.db_name != null; } - public String getTable_name() { - return this.table_name; + public String getTbl_name() { + return this.tbl_name; } - public void setTable_name(String table_name) { - this.table_name = table_name; + public void setTbl_name(String tbl_name) { + this.tbl_name = tbl_name; } - public void unsetTable_name() { - this.table_name = null; + public void unsetTbl_name() { + this.tbl_name = null; } - // Returns true if field table_name is set (has been asigned a value) and false otherwise - public boolean isSetTable_name() { - return this.table_name != null; + // Returns true if field tbl_name is set (has been asigned a value) and false otherwise + public boolean isSetTbl_name() { + return this.tbl_name != null; + } + + public String getFilter() { + return this.filter; + } + + public void setFilter(String filter) { + this.filter = filter; + } + + public void unsetFilter() { + this.filter = null; + } + + // Returns true if field filter is set (has been asigned a value) and false otherwise + public boolean isSetFilter() { + return this.filter != null; + } + + public short getMax_parts() { + return this.max_parts; + } + + public void setMax_parts(short max_parts) { + this.max_parts = max_parts; + this.__isset.max_parts = true; + } + + public void unsetMax_parts() { + this.__isset.max_parts = false; + } + + // Returns true if field max_parts is set (has been asigned a value) and false otherwise + public boolean isSetMax_parts() { + return this.__isset.max_parts; } public void setFieldValue(int fieldID, Object value) { @@ -8269,11 +21303,27 @@ } break; - case TABLE_NAME: + case TBL_NAME: if (value == null) { - unsetTable_name(); + unsetTbl_name(); } else { - setTable_name((String)value); + setTbl_name((String)value); + } + break; + + case FILTER: + if (value == null) { + unsetFilter(); + } else { + setFilter((String)value); + } + break; + + case MAX_PARTS: + if (value == null) { + unsetMax_parts(); + } else { + setMax_parts((Short)value); } break; @@ -8287,8 +21337,14 @@ case DB_NAME: return getDb_name(); - case TABLE_NAME: - return getTable_name(); + case TBL_NAME: + return getTbl_name(); + + case FILTER: + return getFilter(); + + case MAX_PARTS: + return new Short(getMax_parts()); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); @@ -8300,8 +21356,12 @@ switch (fieldID) { case DB_NAME: return isSetDb_name(); - case TABLE_NAME: - return isSetTable_name(); + case TBL_NAME: + return isSetTbl_name(); + case FILTER: + return isSetFilter(); + case MAX_PARTS: + return isSetMax_parts(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -8311,12 +21371,12 @@ public boolean equals(Object that) { if (that == null) return false; - if (that instanceof get_schema_args) - return this.equals((get_schema_args)that); + if (that instanceof get_partitions_by_filter_args) + return this.equals((get_partitions_by_filter_args)that); return false; } - public boolean equals(get_schema_args that) { + public boolean equals(get_partitions_by_filter_args that) { if (that == null) return false; @@ -8329,12 +21389,30 @@ return false; } - boolean this_present_table_name = true && this.isSetTable_name(); - boolean that_present_table_name = true && that.isSetTable_name(); - if (this_present_table_name || that_present_table_name) { - if (!(this_present_table_name && that_present_table_name)) + boolean this_present_tbl_name = true && this.isSetTbl_name(); + boolean that_present_tbl_name = true && that.isSetTbl_name(); + if (this_present_tbl_name || that_present_tbl_name) { + if (!(this_present_tbl_name && that_present_tbl_name)) return false; - if (!this.table_name.equals(that.table_name)) + if (!this.tbl_name.equals(that.tbl_name)) + return false; + } + + boolean this_present_filter = true && this.isSetFilter(); + boolean that_present_filter = true && that.isSetFilter(); + if (this_present_filter || that_present_filter) { + if (!(this_present_filter && that_present_filter)) + return false; + if (!this.filter.equals(that.filter)) + return false; + } + + boolean this_present_max_parts = true; + boolean that_present_max_parts = true; + if (this_present_max_parts || that_present_max_parts) { + if (!(this_present_max_parts && that_present_max_parts)) + return false; + if (this.max_parts != that.max_parts) return false; } @@ -8364,9 +21442,24 @@ TProtocolUtil.skip(iprot, field.type); } break; - case TABLE_NAME: + case TBL_NAME: if (field.type == TType.STRING) { - this.table_name = iprot.readString(); + this.tbl_name = iprot.readString(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case FILTER: + if (field.type == TType.STRING) { + this.filter = iprot.readString(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case MAX_PARTS: + if (field.type == TType.I16) { + this.max_parts = iprot.readI16(); + this.__isset.max_parts = true; } else { TProtocolUtil.skip(iprot, field.type); } @@ -8391,18 +21484,26 @@ oprot.writeString(this.db_name); oprot.writeFieldEnd(); } - if (this.table_name != null) { - oprot.writeFieldBegin(TABLE_NAME_FIELD_DESC); - oprot.writeString(this.table_name); + if (this.tbl_name != null) { + oprot.writeFieldBegin(TBL_NAME_FIELD_DESC); + oprot.writeString(this.tbl_name); + oprot.writeFieldEnd(); + } + if (this.filter != null) { + oprot.writeFieldBegin(FILTER_FIELD_DESC); + oprot.writeString(this.filter); oprot.writeFieldEnd(); } + oprot.writeFieldBegin(MAX_PARTS_FIELD_DESC); + oprot.writeI16(this.max_parts); + oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } @Override public String toString() { - StringBuilder sb = new StringBuilder("get_schema_args("); + StringBuilder sb = new StringBuilder("get_partitions_by_filter_args("); boolean first = true; sb.append("db_name:"); @@ -8413,13 +21514,25 @@ } first = false; if (!first) sb.append(", "); - sb.append("table_name:"); - if (this.table_name == null) { + sb.append("tbl_name:"); + if (this.tbl_name == null) { sb.append("null"); } else { - sb.append(this.table_name); + sb.append(this.tbl_name); + } + first = false; + if (!first) sb.append(", "); + sb.append("filter:"); + if (this.filter == null) { + sb.append("null"); + } else { + sb.append(this.filter); } first = false; + if (!first) sb.append(", "); + sb.append("max_parts:"); + sb.append(this.max_parts); + first = false; sb.append(")"); return sb.toString(); } @@ -8431,21 +21544,18 @@ } - public static class get_schema_result implements TBase, java.io.Serializable, Cloneable { - private static final TStruct STRUCT_DESC = new TStruct("get_schema_result"); + public static class get_partitions_by_filter_result implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("get_partitions_by_filter_result"); private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.LIST, (short)0); private static final TField O1_FIELD_DESC = new TField("o1", TType.STRUCT, (short)1); private static final TField O2_FIELD_DESC = new TField("o2", TType.STRUCT, (short)2); - private static final TField O3_FIELD_DESC = new TField("o3", TType.STRUCT, (short)3); - private List success; + private List success; public static final int SUCCESS = 0; private MetaException o1; public static final int O1 = 1; - private UnknownTableException o2; + private NoSuchObjectException o2; public static final int O2 = 2; - private UnknownDBException o3; - public static final int O3 = 3; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { @@ -8454,43 +21564,39 @@ public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ put(SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, new ListMetaData(TType.LIST, - new StructMetaData(TType.STRUCT, FieldSchema.class)))); + new StructMetaData(TType.STRUCT, Partition.class)))); put(O1, new FieldMetaData("o1", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRUCT))); put(O2, new FieldMetaData("o2", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRUCT))); - put(O3, new FieldMetaData("o3", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRUCT))); }}); static { - FieldMetaData.addStructMetaDataMap(get_schema_result.class, metaDataMap); + FieldMetaData.addStructMetaDataMap(get_partitions_by_filter_result.class, metaDataMap); } - public get_schema_result() { + public get_partitions_by_filter_result() { } - public get_schema_result( - List success, + public get_partitions_by_filter_result( + List success, MetaException o1, - UnknownTableException o2, - UnknownDBException o3) + NoSuchObjectException o2) { this(); this.success = success; this.o1 = o1; this.o2 = o2; - this.o3 = o3; } /** * Performs a deep copy on other. */ - public get_schema_result(get_schema_result other) { + public get_partitions_by_filter_result(get_partitions_by_filter_result other) { if (other.isSetSuccess()) { - List __this__success = new ArrayList(); - for (FieldSchema other_element : other.success) { - __this__success.add(new FieldSchema(other_element)); + List __this__success = new ArrayList(); + for (Partition other_element : other.success) { + __this__success.add(new Partition(other_element)); } this.success = __this__success; } @@ -8498,38 +21604,35 @@ this.o1 = new MetaException(other.o1); } if (other.isSetO2()) { - this.o2 = new UnknownTableException(other.o2); - } - if (other.isSetO3()) { - this.o3 = new UnknownDBException(other.o3); + this.o2 = new NoSuchObjectException(other.o2); } } @Override - public get_schema_result clone() { - return new get_schema_result(this); + public get_partitions_by_filter_result clone() { + return new get_partitions_by_filter_result(this); } public int getSuccessSize() { return (this.success == null) ? 0 : this.success.size(); } - public java.util.Iterator getSuccessIterator() { + public java.util.Iterator getSuccessIterator() { return (this.success == null) ? null : this.success.iterator(); } - public void addToSuccess(FieldSchema elem) { + public void addToSuccess(Partition elem) { if (this.success == null) { - this.success = new ArrayList(); + this.success = new ArrayList(); } this.success.add(elem); } - public List getSuccess() { + public List getSuccess() { return this.success; } - public void setSuccess(List success) { + public void setSuccess(List success) { this.success = success; } @@ -8559,11 +21662,11 @@ return this.o1 != null; } - public UnknownTableException getO2() { + public NoSuchObjectException getO2() { return this.o2; } - public void setO2(UnknownTableException o2) { + public void setO2(NoSuchObjectException o2) { this.o2 = o2; } @@ -8576,30 +21679,13 @@ return this.o2 != null; } - public UnknownDBException getO3() { - return this.o3; - } - - public void setO3(UnknownDBException o3) { - this.o3 = o3; - } - - public void unsetO3() { - this.o3 = null; - } - - // Returns true if field o3 is set (has been asigned a value) and false otherwise - public boolean isSetO3() { - return this.o3 != null; - } - public void setFieldValue(int fieldID, Object value) { switch (fieldID) { case SUCCESS: if (value == null) { unsetSuccess(); } else { - setSuccess((List)value); + setSuccess((List)value); } break; @@ -8615,15 +21701,7 @@ if (value == null) { unsetO2(); } else { - setO2((UnknownTableException)value); - } - break; - - case O3: - if (value == null) { - unsetO3(); - } else { - setO3((UnknownDBException)value); + setO2((NoSuchObjectException)value); } break; @@ -8643,9 +21721,6 @@ case O2: return getO2(); - case O3: - return getO3(); - default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -8660,8 +21735,6 @@ return isSetO1(); case O2: return isSetO2(); - case O3: - return isSetO3(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -8671,12 +21744,12 @@ public boolean equals(Object that) { if (that == null) return false; - if (that instanceof get_schema_result) - return this.equals((get_schema_result)that); + if (that instanceof get_partitions_by_filter_result) + return this.equals((get_partitions_by_filter_result)that); return false; } - public boolean equals(get_schema_result that) { + public boolean equals(get_partitions_by_filter_result that) { if (that == null) return false; @@ -8707,15 +21780,6 @@ return false; } - boolean this_present_o3 = true && this.isSetO3(); - boolean that_present_o3 = true && that.isSetO3(); - if (this_present_o3 || that_present_o3) { - if (!(this_present_o3 && that_present_o3)) - return false; - if (!this.o3.equals(that.o3)) - return false; - } - return true; } @@ -8738,14 +21802,14 @@ case SUCCESS: if (field.type == TType.LIST) { { - TList _list75 = iprot.readListBegin(); - this.success = new ArrayList(_list75.size); - for (int _i76 = 0; _i76 < _list75.size; ++_i76) + TList _list162 = iprot.readListBegin(); + this.success = new ArrayList(_list162.size); + for (int _i163 = 0; _i163 < _list162.size; ++_i163) { - FieldSchema _elem77; - _elem77 = new FieldSchema(); - _elem77.read(iprot); - this.success.add(_elem77); + Partition _elem164; + _elem164 = new Partition(); + _elem164.read(iprot); + this.success.add(_elem164); } iprot.readListEnd(); } @@ -8763,20 +21827,12 @@ break; case O2: if (field.type == TType.STRUCT) { - this.o2 = new UnknownTableException(); + this.o2 = new NoSuchObjectException(); this.o2.read(iprot); } else { TProtocolUtil.skip(iprot, field.type); } break; - case O3: - if (field.type == TType.STRUCT) { - this.o3 = new UnknownDBException(); - this.o3.read(iprot); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; default: TProtocolUtil.skip(iprot, field.type); break; @@ -8795,8 +21851,8 @@ oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeListBegin(new TList(TType.STRUCT, this.success.size())); - for (FieldSchema _iter78 : this.success) { - _iter78.write(oprot); + for (Partition _iter165 : this.success) { + _iter165.write(oprot); } oprot.writeListEnd(); } @@ -8809,10 +21865,6 @@ oprot.writeFieldBegin(O2_FIELD_DESC); this.o2.write(oprot); oprot.writeFieldEnd(); - } else if (this.isSetO3()) { - oprot.writeFieldBegin(O3_FIELD_DESC); - this.o3.write(oprot); - oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); @@ -8820,7 +21872,7 @@ @Override public String toString() { - StringBuilder sb = new StringBuilder("get_schema_result("); + StringBuilder sb = new StringBuilder("get_partitions_by_filter_result("); boolean first = true; sb.append("success:"); @@ -8846,14 +21898,6 @@ sb.append(this.o2); } first = false; - if (!first) sb.append(", "); - sb.append("o3:"); - if (this.o3 == null) { - sb.append("null"); - } else { - sb.append(this.o3); - } - first = false; sb.append(")"); return sb.toString(); } @@ -8865,74 +21909,144 @@ } - public static class create_table_args implements TBase, java.io.Serializable, Cloneable { - private static final TStruct STRUCT_DESC = new TStruct("create_table_args"); - private static final TField TBL_FIELD_DESC = new TField("tbl", TType.STRUCT, (short)1); + public static class alter_partition_args implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("alter_partition_args"); + private static final TField DB_NAME_FIELD_DESC = new TField("db_name", TType.STRING, (short)1); + private static final TField TBL_NAME_FIELD_DESC = new TField("tbl_name", TType.STRING, (short)2); + private static final TField NEW_PART_FIELD_DESC = new TField("new_part", TType.STRUCT, (short)3); - private Table tbl; - public static final int TBL = 1; + private String db_name; + public static final int DB_NAME = 1; + private String tbl_name; + public static final int TBL_NAME = 2; + private Partition new_part; + public static final int NEW_PART = 3; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { } public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ - put(TBL, new FieldMetaData("tbl", TFieldRequirementType.DEFAULT, - new StructMetaData(TType.STRUCT, Table.class))); + put(DB_NAME, new FieldMetaData("db_name", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + put(TBL_NAME, new FieldMetaData("tbl_name", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + put(NEW_PART, new FieldMetaData("new_part", TFieldRequirementType.DEFAULT, + new StructMetaData(TType.STRUCT, Partition.class))); }}); static { - FieldMetaData.addStructMetaDataMap(create_table_args.class, metaDataMap); + FieldMetaData.addStructMetaDataMap(alter_partition_args.class, metaDataMap); } - public create_table_args() { + public alter_partition_args() { } - public create_table_args( - Table tbl) + public alter_partition_args( + String db_name, + String tbl_name, + Partition new_part) { this(); - this.tbl = tbl; + this.db_name = db_name; + this.tbl_name = tbl_name; + this.new_part = new_part; } /** * Performs a deep copy on other. */ - public create_table_args(create_table_args other) { - if (other.isSetTbl()) { - this.tbl = new Table(other.tbl); + public alter_partition_args(alter_partition_args other) { + if (other.isSetDb_name()) { + this.db_name = other.db_name; + } + if (other.isSetTbl_name()) { + this.tbl_name = other.tbl_name; + } + if (other.isSetNew_part()) { + this.new_part = new Partition(other.new_part); } } @Override - public create_table_args clone() { - return new create_table_args(this); + public alter_partition_args clone() { + return new alter_partition_args(this); } - public Table getTbl() { - return this.tbl; + public String getDb_name() { + return this.db_name; } - public void setTbl(Table tbl) { - this.tbl = tbl; + public void setDb_name(String db_name) { + this.db_name = db_name; } - public void unsetTbl() { - this.tbl = null; + public void unsetDb_name() { + this.db_name = null; } - // Returns true if field tbl is set (has been asigned a value) and false otherwise - public boolean isSetTbl() { - return this.tbl != null; + // Returns true if field db_name is set (has been asigned a value) and false otherwise + public boolean isSetDb_name() { + return this.db_name != null; + } + + public String getTbl_name() { + return this.tbl_name; + } + + public void setTbl_name(String tbl_name) { + this.tbl_name = tbl_name; + } + + public void unsetTbl_name() { + this.tbl_name = null; + } + + // Returns true if field tbl_name is set (has been asigned a value) and false otherwise + public boolean isSetTbl_name() { + return this.tbl_name != null; + } + + public Partition getNew_part() { + return this.new_part; + } + + public void setNew_part(Partition new_part) { + this.new_part = new_part; + } + + public void unsetNew_part() { + this.new_part = null; + } + + // Returns true if field new_part is set (has been asigned a value) and false otherwise + public boolean isSetNew_part() { + return this.new_part != null; } public void setFieldValue(int fieldID, Object value) { switch (fieldID) { - case TBL: + case DB_NAME: if (value == null) { - unsetTbl(); + unsetDb_name(); } else { - setTbl((Table)value); + setDb_name((String)value); + } + break; + + case TBL_NAME: + if (value == null) { + unsetTbl_name(); + } else { + setTbl_name((String)value); + } + break; + + case NEW_PART: + if (value == null) { + unsetNew_part(); + } else { + setNew_part((Partition)value); } break; @@ -8943,8 +22057,14 @@ public Object getFieldValue(int fieldID) { switch (fieldID) { - case TBL: - return getTbl(); + case DB_NAME: + return getDb_name(); + + case TBL_NAME: + return getTbl_name(); + + case NEW_PART: + return getNew_part(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); @@ -8954,8 +22074,12 @@ // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise public boolean isSet(int fieldID) { switch (fieldID) { - case TBL: - return isSetTbl(); + case DB_NAME: + return isSetDb_name(); + case TBL_NAME: + return isSetTbl_name(); + case NEW_PART: + return isSetNew_part(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -8965,21 +22089,39 @@ public boolean equals(Object that) { if (that == null) return false; - if (that instanceof create_table_args) - return this.equals((create_table_args)that); + if (that instanceof alter_partition_args) + return this.equals((alter_partition_args)that); return false; } - public boolean equals(create_table_args that) { + public boolean equals(alter_partition_args that) { if (that == null) return false; - boolean this_present_tbl = true && this.isSetTbl(); - boolean that_present_tbl = true && that.isSetTbl(); - if (this_present_tbl || that_present_tbl) { - if (!(this_present_tbl && that_present_tbl)) + 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) { + if (!(this_present_db_name && that_present_db_name)) return false; - if (!this.tbl.equals(that.tbl)) + if (!this.db_name.equals(that.db_name)) + return false; + } + + boolean this_present_tbl_name = true && this.isSetTbl_name(); + boolean that_present_tbl_name = true && that.isSetTbl_name(); + if (this_present_tbl_name || that_present_tbl_name) { + if (!(this_present_tbl_name && that_present_tbl_name)) + return false; + if (!this.tbl_name.equals(that.tbl_name)) + return false; + } + + boolean this_present_new_part = true && this.isSetNew_part(); + boolean that_present_new_part = true && that.isSetNew_part(); + if (this_present_new_part || that_present_new_part) { + if (!(this_present_new_part && that_present_new_part)) + return false; + if (!this.new_part.equals(that.new_part)) return false; } @@ -9002,10 +22144,24 @@ } switch (field.id) { - case TBL: + case DB_NAME: + if (field.type == TType.STRING) { + this.db_name = iprot.readString(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case TBL_NAME: + if (field.type == TType.STRING) { + this.tbl_name = iprot.readString(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case NEW_PART: if (field.type == TType.STRUCT) { - this.tbl = new Table(); - this.tbl.read(iprot); + this.new_part = new Partition(); + this.new_part.read(iprot); } else { TProtocolUtil.skip(iprot, field.type); } @@ -9025,9 +22181,19 @@ validate(); oprot.writeStructBegin(STRUCT_DESC); - if (this.tbl != null) { - oprot.writeFieldBegin(TBL_FIELD_DESC); - this.tbl.write(oprot); + if (this.db_name != null) { + oprot.writeFieldBegin(DB_NAME_FIELD_DESC); + oprot.writeString(this.db_name); + oprot.writeFieldEnd(); + } + if (this.tbl_name != null) { + oprot.writeFieldBegin(TBL_NAME_FIELD_DESC); + oprot.writeString(this.tbl_name); + oprot.writeFieldEnd(); + } + if (this.new_part != null) { + oprot.writeFieldBegin(NEW_PART_FIELD_DESC); + this.new_part.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); @@ -9036,14 +22202,30 @@ @Override public String toString() { - StringBuilder sb = new StringBuilder("create_table_args("); + StringBuilder sb = new StringBuilder("alter_partition_args("); boolean first = true; - sb.append("tbl:"); - if (this.tbl == null) { + sb.append("db_name:"); + if (this.db_name == null) { sb.append("null"); } else { - sb.append(this.tbl); + sb.append(this.db_name); + } + first = false; + if (!first) sb.append(", "); + sb.append("tbl_name:"); + if (this.tbl_name == null) { + sb.append("null"); + } else { + sb.append(this.tbl_name); + } + first = false; + if (!first) sb.append(", "); + sb.append("new_part:"); + if (this.new_part == null) { + sb.append("null"); + } else { + sb.append(this.new_part); } first = false; sb.append(")"); @@ -9057,21 +22239,15 @@ } - public static class create_table_result implements TBase, java.io.Serializable, Cloneable { - private static final TStruct STRUCT_DESC = new TStruct("create_table_result"); + public static class alter_partition_result implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("alter_partition_result"); private static final TField O1_FIELD_DESC = new TField("o1", TType.STRUCT, (short)1); private static final TField O2_FIELD_DESC = new TField("o2", TType.STRUCT, (short)2); - private static final TField O3_FIELD_DESC = new TField("o3", TType.STRUCT, (short)3); - private static final TField O4_FIELD_DESC = new TField("o4", TType.STRUCT, (short)4); - private AlreadyExistsException o1; + private InvalidOperationException o1; public static final int O1 = 1; - private InvalidObjectException o2; + private MetaException o2; public static final int O2 = 2; - private MetaException o3; - public static final int O3 = 3; - private NoSuchObjectException o4; - public static final int O4 = 4; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { @@ -9082,60 +22258,46 @@ new FieldValueMetaData(TType.STRUCT))); put(O2, new FieldMetaData("o2", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRUCT))); - put(O3, new FieldMetaData("o3", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRUCT))); - put(O4, new FieldMetaData("o4", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRUCT))); }}); static { - FieldMetaData.addStructMetaDataMap(create_table_result.class, metaDataMap); + FieldMetaData.addStructMetaDataMap(alter_partition_result.class, metaDataMap); } - public create_table_result() { + public alter_partition_result() { } - public create_table_result( - AlreadyExistsException o1, - InvalidObjectException o2, - MetaException o3, - NoSuchObjectException o4) + public alter_partition_result( + InvalidOperationException o1, + MetaException o2) { this(); this.o1 = o1; this.o2 = o2; - this.o3 = o3; - this.o4 = o4; } /** * Performs a deep copy on other. */ - public create_table_result(create_table_result other) { + public alter_partition_result(alter_partition_result other) { if (other.isSetO1()) { - this.o1 = new AlreadyExistsException(other.o1); + this.o1 = new InvalidOperationException(other.o1); } if (other.isSetO2()) { - this.o2 = new InvalidObjectException(other.o2); - } - if (other.isSetO3()) { - this.o3 = new MetaException(other.o3); - } - if (other.isSetO4()) { - this.o4 = new NoSuchObjectException(other.o4); + this.o2 = new MetaException(other.o2); } } @Override - public create_table_result clone() { - return new create_table_result(this); + public alter_partition_result clone() { + return new alter_partition_result(this); } - public AlreadyExistsException getO1() { + public InvalidOperationException getO1() { return this.o1; } - public void setO1(AlreadyExistsException o1) { + public void setO1(InvalidOperationException o1) { this.o1 = o1; } @@ -9148,11 +22310,11 @@ return this.o1 != null; } - public InvalidObjectException getO2() { + public MetaException getO2() { return this.o2; } - public void setO2(InvalidObjectException o2) { + public void setO2(MetaException o2) { this.o2 = o2; } @@ -9165,47 +22327,13 @@ return this.o2 != null; } - public MetaException getO3() { - return this.o3; - } - - public void setO3(MetaException o3) { - this.o3 = o3; - } - - public void unsetO3() { - this.o3 = null; - } - - // Returns true if field o3 is set (has been asigned a value) and false otherwise - public boolean isSetO3() { - return this.o3 != null; - } - - public NoSuchObjectException getO4() { - return this.o4; - } - - public void setO4(NoSuchObjectException o4) { - this.o4 = o4; - } - - public void unsetO4() { - this.o4 = null; - } - - // Returns true if field o4 is set (has been asigned a value) and false otherwise - public boolean isSetO4() { - return this.o4 != null; - } - public void setFieldValue(int fieldID, Object value) { switch (fieldID) { case O1: if (value == null) { unsetO1(); } else { - setO1((AlreadyExistsException)value); + setO1((InvalidOperationException)value); } break; @@ -9213,23 +22341,7 @@ if (value == null) { unsetO2(); } else { - setO2((InvalidObjectException)value); - } - break; - - case O3: - if (value == null) { - unsetO3(); - } else { - setO3((MetaException)value); - } - break; - - case O4: - if (value == null) { - unsetO4(); - } else { - setO4((NoSuchObjectException)value); + setO2((MetaException)value); } break; @@ -9246,12 +22358,6 @@ case O2: return getO2(); - case O3: - return getO3(); - - case O4: - return getO4(); - default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -9264,10 +22370,6 @@ return isSetO1(); case O2: return isSetO2(); - case O3: - return isSetO3(); - case O4: - return isSetO4(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -9277,12 +22379,12 @@ public boolean equals(Object that) { if (that == null) return false; - if (that instanceof create_table_result) - return this.equals((create_table_result)that); + if (that instanceof alter_partition_result) + return this.equals((alter_partition_result)that); return false; } - public boolean equals(create_table_result that) { + public boolean equals(alter_partition_result that) { if (that == null) return false; @@ -9304,24 +22406,6 @@ return false; } - boolean this_present_o3 = true && this.isSetO3(); - boolean that_present_o3 = true && that.isSetO3(); - if (this_present_o3 || that_present_o3) { - if (!(this_present_o3 && that_present_o3)) - return false; - if (!this.o3.equals(that.o3)) - return false; - } - - boolean this_present_o4 = true && this.isSetO4(); - boolean that_present_o4 = true && that.isSetO4(); - if (this_present_o4 || that_present_o4) { - if (!(this_present_o4 && that_present_o4)) - return false; - if (!this.o4.equals(that.o4)) - return false; - } - return true; } @@ -9343,7 +22427,7 @@ { case O1: if (field.type == TType.STRUCT) { - this.o1 = new AlreadyExistsException(); + this.o1 = new InvalidOperationException(); this.o1.read(iprot); } else { TProtocolUtil.skip(iprot, field.type); @@ -9351,28 +22435,12 @@ break; case O2: if (field.type == TType.STRUCT) { - this.o2 = new InvalidObjectException(); + this.o2 = new MetaException(); this.o2.read(iprot); } else { TProtocolUtil.skip(iprot, field.type); } break; - case O3: - if (field.type == TType.STRUCT) { - this.o3 = new MetaException(); - this.o3.read(iprot); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - case O4: - if (field.type == TType.STRUCT) { - this.o4 = new NoSuchObjectException(); - this.o4.read(iprot); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; default: TProtocolUtil.skip(iprot, field.type); break; @@ -9395,14 +22463,6 @@ oprot.writeFieldBegin(O2_FIELD_DESC); this.o2.write(oprot); oprot.writeFieldEnd(); - } else if (this.isSetO3()) { - oprot.writeFieldBegin(O3_FIELD_DESC); - this.o3.write(oprot); - oprot.writeFieldEnd(); - } else if (this.isSetO4()) { - oprot.writeFieldBegin(O4_FIELD_DESC); - this.o4.write(oprot); - oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); @@ -9410,7 +22470,7 @@ @Override public String toString() { - StringBuilder sb = new StringBuilder("create_table_result("); + StringBuilder sb = new StringBuilder("alter_partition_result("); boolean first = true; sb.append("o1:"); @@ -9428,22 +22488,6 @@ sb.append(this.o2); } first = false; - if (!first) sb.append(", "); - sb.append("o3:"); - if (this.o3 == null) { - sb.append("null"); - } else { - sb.append(this.o3); - } - first = false; - if (!first) sb.append(", "); - sb.append("o4:"); - if (this.o4 == null) { - sb.append("null"); - } else { - sb.append(this.o4); - } - first = false; sb.append(")"); return sb.toString(); } @@ -9455,86 +22499,58 @@ } - public static class drop_table_args implements TBase, java.io.Serializable, Cloneable { - private static final TStruct STRUCT_DESC = new TStruct("drop_table_args"); - private static final TField DBNAME_FIELD_DESC = new TField("dbname", TType.STRING, (short)1); - private static final TField NAME_FIELD_DESC = new TField("name", TType.STRING, (short)2); - private static final TField DELETE_DATA_FIELD_DESC = new TField("deleteData", TType.BOOL, (short)3); + public static class get_config_value_args implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("get_config_value_args"); + private static final TField NAME_FIELD_DESC = new TField("name", TType.STRING, (short)1); + private static final TField DEFAULT_VALUE_FIELD_DESC = new TField("defaultValue", TType.STRING, (short)2); - private String dbname; - public static final int DBNAME = 1; private String name; - public static final int NAME = 2; - private boolean deleteData; - public static final int DELETEDATA = 3; + public static final int NAME = 1; + private String defaultValue; + public static final int DEFAULTVALUE = 2; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { - public boolean deleteData = false; } public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ - put(DBNAME, new FieldMetaData("dbname", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRING))); put(NAME, new FieldMetaData("name", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRING))); - put(DELETEDATA, new FieldMetaData("deleteData", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.BOOL))); + put(DEFAULTVALUE, new FieldMetaData("defaultValue", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); }}); static { - FieldMetaData.addStructMetaDataMap(drop_table_args.class, metaDataMap); + FieldMetaData.addStructMetaDataMap(get_config_value_args.class, metaDataMap); } - public drop_table_args() { + public get_config_value_args() { } - public drop_table_args( - String dbname, + public get_config_value_args( String name, - boolean deleteData) + String defaultValue) { this(); - this.dbname = dbname; this.name = name; - this.deleteData = deleteData; - this.__isset.deleteData = true; + this.defaultValue = defaultValue; } /** * Performs a deep copy on other. */ - public drop_table_args(drop_table_args other) { - if (other.isSetDbname()) { - this.dbname = other.dbname; - } + public get_config_value_args(get_config_value_args other) { if (other.isSetName()) { this.name = other.name; } - __isset.deleteData = other.__isset.deleteData; - this.deleteData = other.deleteData; + if (other.isSetDefaultValue()) { + this.defaultValue = other.defaultValue; + } } @Override - public drop_table_args clone() { - return new drop_table_args(this); - } - - public String getDbname() { - return this.dbname; - } - - public void setDbname(String dbname) { - this.dbname = dbname; - } - - public void unsetDbname() { - this.dbname = null; - } - - // Returns true if field dbname is set (has been asigned a value) and false otherwise - public boolean isSetDbname() { - return this.dbname != null; + public get_config_value_args clone() { + return new get_config_value_args(this); } public String getName() { @@ -9554,34 +22570,25 @@ return this.name != null; } - public boolean isDeleteData() { - return this.deleteData; + public String getDefaultValue() { + return this.defaultValue; } - public void setDeleteData(boolean deleteData) { - this.deleteData = deleteData; - this.__isset.deleteData = true; + public void setDefaultValue(String defaultValue) { + this.defaultValue = defaultValue; } - public void unsetDeleteData() { - this.__isset.deleteData = false; + public void unsetDefaultValue() { + this.defaultValue = null; } - // Returns true if field deleteData is set (has been asigned a value) and false otherwise - public boolean isSetDeleteData() { - return this.__isset.deleteData; + // Returns true if field defaultValue is set (has been asigned a value) and false otherwise + public boolean isSetDefaultValue() { + return this.defaultValue != null; } public void setFieldValue(int fieldID, Object value) { switch (fieldID) { - case DBNAME: - if (value == null) { - unsetDbname(); - } else { - setDbname((String)value); - } - break; - case NAME: if (value == null) { unsetName(); @@ -9590,11 +22597,11 @@ } break; - case DELETEDATA: + case DEFAULTVALUE: if (value == null) { - unsetDeleteData(); + unsetDefaultValue(); } else { - setDeleteData((Boolean)value); + setDefaultValue((String)value); } break; @@ -9605,14 +22612,11 @@ public Object getFieldValue(int fieldID) { switch (fieldID) { - case DBNAME: - return getDbname(); - case NAME: return getName(); - case DELETEDATA: - return new Boolean(isDeleteData()); + case DEFAULTVALUE: + return getDefaultValue(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); @@ -9622,12 +22626,10 @@ // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise public boolean isSet(int fieldID) { switch (fieldID) { - case DBNAME: - return isSetDbname(); case NAME: return isSetName(); - case DELETEDATA: - return isSetDeleteData(); + case DEFAULTVALUE: + return isSetDefaultValue(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -9637,24 +22639,15 @@ public boolean equals(Object that) { if (that == null) return false; - if (that instanceof drop_table_args) - return this.equals((drop_table_args)that); + if (that instanceof get_config_value_args) + return this.equals((get_config_value_args)that); return false; } - public boolean equals(drop_table_args that) { + public boolean equals(get_config_value_args that) { if (that == null) return false; - boolean this_present_dbname = true && this.isSetDbname(); - boolean that_present_dbname = true && that.isSetDbname(); - if (this_present_dbname || that_present_dbname) { - if (!(this_present_dbname && that_present_dbname)) - return false; - if (!this.dbname.equals(that.dbname)) - return false; - } - boolean this_present_name = true && this.isSetName(); boolean that_present_name = true && that.isSetName(); if (this_present_name || that_present_name) { @@ -9664,12 +22657,12 @@ return false; } - boolean this_present_deleteData = true; - boolean that_present_deleteData = true; - if (this_present_deleteData || that_present_deleteData) { - if (!(this_present_deleteData && that_present_deleteData)) + boolean this_present_defaultValue = true && this.isSetDefaultValue(); + boolean that_present_defaultValue = true && that.isSetDefaultValue(); + if (this_present_defaultValue || that_present_defaultValue) { + if (!(this_present_defaultValue && that_present_defaultValue)) return false; - if (this.deleteData != that.deleteData) + if (!this.defaultValue.equals(that.defaultValue)) return false; } @@ -9692,13 +22685,6 @@ } switch (field.id) { - case DBNAME: - if (field.type == TType.STRING) { - this.dbname = iprot.readString(); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; case NAME: if (field.type == TType.STRING) { this.name = iprot.readString(); @@ -9706,10 +22692,9 @@ TProtocolUtil.skip(iprot, field.type); } break; - case DELETEDATA: - if (field.type == TType.BOOL) { - this.deleteData = iprot.readBool(); - this.__isset.deleteData = true; + case DEFAULTVALUE: + if (field.type == TType.STRING) { + this.defaultValue = iprot.readString(); } else { TProtocolUtil.skip(iprot, field.type); } @@ -9729,36 +22714,25 @@ validate(); oprot.writeStructBegin(STRUCT_DESC); - if (this.dbname != null) { - oprot.writeFieldBegin(DBNAME_FIELD_DESC); - oprot.writeString(this.dbname); - oprot.writeFieldEnd(); - } if (this.name != null) { oprot.writeFieldBegin(NAME_FIELD_DESC); oprot.writeString(this.name); oprot.writeFieldEnd(); } - oprot.writeFieldBegin(DELETE_DATA_FIELD_DESC); - oprot.writeBool(this.deleteData); - oprot.writeFieldEnd(); + if (this.defaultValue != null) { + oprot.writeFieldBegin(DEFAULT_VALUE_FIELD_DESC); + oprot.writeString(this.defaultValue); + oprot.writeFieldEnd(); + } oprot.writeFieldStop(); oprot.writeStructEnd(); } @Override public String toString() { - StringBuilder sb = new StringBuilder("drop_table_args("); + StringBuilder sb = new StringBuilder("get_config_value_args("); boolean first = true; - sb.append("dbname:"); - if (this.dbname == null) { - sb.append("null"); - } else { - sb.append(this.dbname); - } - first = false; - if (!first) sb.append(", "); sb.append("name:"); if (this.name == null) { sb.append("null"); @@ -9767,8 +22741,12 @@ } first = false; if (!first) sb.append(", "); - sb.append("deleteData:"); - sb.append(this.deleteData); + sb.append("defaultValue:"); + if (this.defaultValue == null) { + sb.append("null"); + } else { + sb.append(this.defaultValue); + } first = false; sb.append(")"); return sb.toString(); @@ -9781,109 +22759,109 @@ } - public static class drop_table_result implements TBase, java.io.Serializable, Cloneable { - private static final TStruct STRUCT_DESC = new TStruct("drop_table_result"); + public static class get_config_value_result implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("get_config_value_result"); + private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.STRING, (short)0); private static final TField O1_FIELD_DESC = new TField("o1", TType.STRUCT, (short)1); - private static final TField O3_FIELD_DESC = new TField("o3", TType.STRUCT, (short)2); - private NoSuchObjectException o1; + private String success; + public static final int SUCCESS = 0; + private ConfigValSecurityException o1; public static final int O1 = 1; - private MetaException o3; - public static final int O3 = 2; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { } public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ + put(SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); put(O1, new FieldMetaData("o1", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRUCT))); - put(O3, new FieldMetaData("o3", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRUCT))); }}); static { - FieldMetaData.addStructMetaDataMap(drop_table_result.class, metaDataMap); + FieldMetaData.addStructMetaDataMap(get_config_value_result.class, metaDataMap); } - public drop_table_result() { + public get_config_value_result() { } - public drop_table_result( - NoSuchObjectException o1, - MetaException o3) + public get_config_value_result( + String success, + ConfigValSecurityException o1) { this(); + this.success = success; this.o1 = o1; - this.o3 = o3; } /** * Performs a deep copy on other. */ - public drop_table_result(drop_table_result other) { - if (other.isSetO1()) { - this.o1 = new NoSuchObjectException(other.o1); + public get_config_value_result(get_config_value_result other) { + if (other.isSetSuccess()) { + this.success = other.success; } - if (other.isSetO3()) { - this.o3 = new MetaException(other.o3); + if (other.isSetO1()) { + this.o1 = new ConfigValSecurityException(other.o1); } } @Override - public drop_table_result clone() { - return new drop_table_result(this); + public get_config_value_result clone() { + return new get_config_value_result(this); } - public NoSuchObjectException getO1() { - return this.o1; + public String getSuccess() { + return this.success; } - public void setO1(NoSuchObjectException o1) { - this.o1 = o1; + public void setSuccess(String success) { + this.success = success; } - public void unsetO1() { - this.o1 = null; + public void unsetSuccess() { + this.success = null; } - // Returns true if field o1 is set (has been asigned a value) and false otherwise - public boolean isSetO1() { - return this.o1 != null; + // Returns true if field success is set (has been asigned a value) and false otherwise + public boolean isSetSuccess() { + return this.success != null; } - public MetaException getO3() { - return this.o3; + public ConfigValSecurityException getO1() { + return this.o1; } - public void setO3(MetaException o3) { - this.o3 = o3; + public void setO1(ConfigValSecurityException o1) { + this.o1 = o1; } - public void unsetO3() { - this.o3 = null; + public void unsetO1() { + this.o1 = null; } - // Returns true if field o3 is set (has been asigned a value) and false otherwise - public boolean isSetO3() { - return this.o3 != null; + // Returns true if field o1 is set (has been asigned a value) and false otherwise + public boolean isSetO1() { + return this.o1 != null; } public void setFieldValue(int fieldID, Object value) { switch (fieldID) { - case O1: + case SUCCESS: if (value == null) { - unsetO1(); + unsetSuccess(); } else { - setO1((NoSuchObjectException)value); + setSuccess((String)value); } break; - case O3: + case O1: if (value == null) { - unsetO3(); + unsetO1(); } else { - setO3((MetaException)value); + setO1((ConfigValSecurityException)value); } break; @@ -9894,12 +22872,12 @@ public Object getFieldValue(int fieldID) { switch (fieldID) { + case SUCCESS: + return getSuccess(); + case O1: return getO1(); - case O3: - return getO3(); - default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -9908,10 +22886,10 @@ // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise public boolean isSet(int fieldID) { switch (fieldID) { + case SUCCESS: + return isSetSuccess(); case O1: return isSetO1(); - case O3: - return isSetO3(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -9921,15 +22899,24 @@ public boolean equals(Object that) { if (that == null) return false; - if (that instanceof drop_table_result) - return this.equals((drop_table_result)that); + if (that instanceof get_config_value_result) + return this.equals((get_config_value_result)that); return false; } - public boolean equals(drop_table_result that) { + public boolean equals(get_config_value_result that) { if (that == null) return false; + boolean this_present_success = true && this.isSetSuccess(); + boolean that_present_success = true && that.isSetSuccess(); + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (!this.success.equals(that.success)) + return false; + } + boolean this_present_o1 = true && this.isSetO1(); boolean that_present_o1 = true && that.isSetO1(); if (this_present_o1 || that_present_o1) { @@ -9939,15 +22926,6 @@ return false; } - boolean this_present_o3 = true && this.isSetO3(); - boolean that_present_o3 = true && that.isSetO3(); - if (this_present_o3 || that_present_o3) { - if (!(this_present_o3 && that_present_o3)) - return false; - if (!this.o3.equals(that.o3)) - return false; - } - return true; } @@ -9967,18 +22945,17 @@ } switch (field.id) { - case O1: - if (field.type == TType.STRUCT) { - this.o1 = new NoSuchObjectException(); - this.o1.read(iprot); + case SUCCESS: + if (field.type == TType.STRING) { + this.success = iprot.readString(); } else { TProtocolUtil.skip(iprot, field.type); } break; - case O3: + case O1: if (field.type == TType.STRUCT) { - this.o3 = new MetaException(); - this.o3.read(iprot); + this.o1 = new ConfigValSecurityException(); + this.o1.read(iprot); } else { TProtocolUtil.skip(iprot, field.type); } @@ -9997,14 +22974,14 @@ public void write(TProtocol oprot) throws TException { oprot.writeStructBegin(STRUCT_DESC); - if (this.isSetO1()) { + if (this.isSetSuccess()) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + oprot.writeString(this.success); + oprot.writeFieldEnd(); + } else if (this.isSetO1()) { oprot.writeFieldBegin(O1_FIELD_DESC); this.o1.write(oprot); oprot.writeFieldEnd(); - } else if (this.isSetO3()) { - oprot.writeFieldBegin(O3_FIELD_DESC); - this.o3.write(oprot); - oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); @@ -10012,22 +22989,22 @@ @Override public String toString() { - StringBuilder sb = new StringBuilder("drop_table_result("); + StringBuilder sb = new StringBuilder("get_config_value_result("); boolean first = true; - sb.append("o1:"); - if (this.o1 == null) { + sb.append("success:"); + if (this.success == null) { sb.append("null"); } else { - sb.append(this.o1); + sb.append(this.success); } first = false; if (!first) sb.append(", "); - sb.append("o3:"); - if (this.o3 == null) { + sb.append("o1:"); + if (this.o1 == null) { sb.append("null"); } else { - sb.append(this.o3); + sb.append(this.o1); } first = false; sb.append(")"); @@ -10039,111 +23016,76 @@ // check that fields of type enum have valid values } - } - - public static class get_tables_args implements TBase, java.io.Serializable, Cloneable { - private static final TStruct STRUCT_DESC = new TStruct("get_tables_args"); - private static final TField DB_NAME_FIELD_DESC = new TField("db_name", TType.STRING, (short)1); - private static final TField PATTERN_FIELD_DESC = new TField("pattern", TType.STRING, (short)2); - - private String db_name; - public static final int DB_NAME = 1; - private String pattern; - public static final int PATTERN = 2; + } + + public static class partition_name_to_vals_args implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("partition_name_to_vals_args"); + private static final TField PART_NAME_FIELD_DESC = new TField("part_name", TType.STRING, (short)1); + + private String part_name; + public static final int PART_NAME = 1; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { } public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ - put(DB_NAME, new FieldMetaData("db_name", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRING))); - put(PATTERN, new FieldMetaData("pattern", TFieldRequirementType.DEFAULT, + put(PART_NAME, new FieldMetaData("part_name", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRING))); }}); static { - FieldMetaData.addStructMetaDataMap(get_tables_args.class, metaDataMap); + FieldMetaData.addStructMetaDataMap(partition_name_to_vals_args.class, metaDataMap); } - public get_tables_args() { + public partition_name_to_vals_args() { } - public get_tables_args( - String db_name, - String pattern) + public partition_name_to_vals_args( + String part_name) { this(); - this.db_name = db_name; - this.pattern = pattern; + this.part_name = part_name; } /** * Performs a deep copy on other. */ - public get_tables_args(get_tables_args other) { - if (other.isSetDb_name()) { - this.db_name = other.db_name; - } - if (other.isSetPattern()) { - this.pattern = other.pattern; + public partition_name_to_vals_args(partition_name_to_vals_args other) { + if (other.isSetPart_name()) { + this.part_name = other.part_name; } } @Override - public get_tables_args clone() { - return new get_tables_args(this); - } - - public String getDb_name() { - return this.db_name; - } - - public void setDb_name(String db_name) { - this.db_name = db_name; - } - - public void unsetDb_name() { - this.db_name = null; - } - - // Returns true if field db_name is set (has been asigned a value) and false otherwise - public boolean isSetDb_name() { - return this.db_name != null; + public partition_name_to_vals_args clone() { + return new partition_name_to_vals_args(this); } - public String getPattern() { - return this.pattern; + public String getPart_name() { + return this.part_name; } - public void setPattern(String pattern) { - this.pattern = pattern; + public void setPart_name(String part_name) { + this.part_name = part_name; } - public void unsetPattern() { - this.pattern = null; + public void unsetPart_name() { + this.part_name = null; } - // Returns true if field pattern is set (has been asigned a value) and false otherwise - public boolean isSetPattern() { - return this.pattern != null; + // Returns true if field part_name is set (has been asigned a value) and false otherwise + public boolean isSetPart_name() { + return this.part_name != null; } public void setFieldValue(int fieldID, Object value) { switch (fieldID) { - case DB_NAME: - if (value == null) { - unsetDb_name(); - } else { - setDb_name((String)value); - } - break; - - case PATTERN: + case PART_NAME: if (value == null) { - unsetPattern(); + unsetPart_name(); } else { - setPattern((String)value); + setPart_name((String)value); } break; @@ -10154,11 +23096,8 @@ public Object getFieldValue(int fieldID) { switch (fieldID) { - case DB_NAME: - return getDb_name(); - - case PATTERN: - return getPattern(); + case PART_NAME: + return getPart_name(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); @@ -10168,10 +23107,8 @@ // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise public boolean isSet(int fieldID) { switch (fieldID) { - case DB_NAME: - return isSetDb_name(); - case PATTERN: - return isSetPattern(); + case PART_NAME: + return isSetPart_name(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -10181,30 +23118,21 @@ public boolean equals(Object that) { if (that == null) return false; - if (that instanceof get_tables_args) - return this.equals((get_tables_args)that); + if (that instanceof partition_name_to_vals_args) + return this.equals((partition_name_to_vals_args)that); return false; } - public boolean equals(get_tables_args that) { + public boolean equals(partition_name_to_vals_args that) { if (that == null) 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) { - if (!(this_present_db_name && that_present_db_name)) - return false; - if (!this.db_name.equals(that.db_name)) - return false; - } - - boolean this_present_pattern = true && this.isSetPattern(); - boolean that_present_pattern = true && that.isSetPattern(); - if (this_present_pattern || that_present_pattern) { - if (!(this_present_pattern && that_present_pattern)) + boolean this_present_part_name = true && this.isSetPart_name(); + boolean that_present_part_name = true && that.isSetPart_name(); + if (this_present_part_name || that_present_part_name) { + if (!(this_present_part_name && that_present_part_name)) return false; - if (!this.pattern.equals(that.pattern)) + if (!this.part_name.equals(that.part_name)) return false; } @@ -10227,16 +23155,9 @@ } switch (field.id) { - case DB_NAME: - if (field.type == TType.STRING) { - this.db_name = iprot.readString(); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - case PATTERN: + case PART_NAME: if (field.type == TType.STRING) { - this.pattern = iprot.readString(); + this.part_name = iprot.readString(); } else { TProtocolUtil.skip(iprot, field.type); } @@ -10256,14 +23177,9 @@ validate(); oprot.writeStructBegin(STRUCT_DESC); - if (this.db_name != null) { - oprot.writeFieldBegin(DB_NAME_FIELD_DESC); - oprot.writeString(this.db_name); - oprot.writeFieldEnd(); - } - if (this.pattern != null) { - oprot.writeFieldBegin(PATTERN_FIELD_DESC); - oprot.writeString(this.pattern); + if (this.part_name != null) { + oprot.writeFieldBegin(PART_NAME_FIELD_DESC); + oprot.writeString(this.part_name); oprot.writeFieldEnd(); } oprot.writeFieldStop(); @@ -10272,22 +23188,14 @@ @Override public String toString() { - StringBuilder sb = new StringBuilder("get_tables_args("); + StringBuilder sb = new StringBuilder("partition_name_to_vals_args("); boolean first = true; - sb.append("db_name:"); - if (this.db_name == null) { - sb.append("null"); - } else { - sb.append(this.db_name); - } - first = false; - if (!first) sb.append(", "); - sb.append("pattern:"); - if (this.pattern == null) { + sb.append("part_name:"); + if (this.part_name == null) { sb.append("null"); } else { - sb.append(this.pattern); + sb.append(this.part_name); } first = false; sb.append(")"); @@ -10301,8 +23209,8 @@ } - public static class get_tables_result implements TBase, java.io.Serializable, Cloneable { - private static final TStruct STRUCT_DESC = new TStruct("get_tables_result"); + public static class partition_name_to_vals_result implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("partition_name_to_vals_result"); private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.LIST, (short)0); private static final TField O1_FIELD_DESC = new TField("o1", TType.STRUCT, (short)1); @@ -10324,13 +23232,13 @@ }}); static { - FieldMetaData.addStructMetaDataMap(get_tables_result.class, metaDataMap); + FieldMetaData.addStructMetaDataMap(partition_name_to_vals_result.class, metaDataMap); } - public get_tables_result() { + public partition_name_to_vals_result() { } - public get_tables_result( + public partition_name_to_vals_result( List success, MetaException o1) { @@ -10342,7 +23250,7 @@ /** * Performs a deep copy on other. */ - public get_tables_result(get_tables_result other) { + public partition_name_to_vals_result(partition_name_to_vals_result other) { if (other.isSetSuccess()) { List __this__success = new ArrayList(); for (String other_element : other.success) { @@ -10356,8 +23264,8 @@ } @Override - public get_tables_result clone() { - return new get_tables_result(this); + public partition_name_to_vals_result clone() { + return new partition_name_to_vals_result(this); } public int getSuccessSize() { @@ -10461,12 +23369,12 @@ public boolean equals(Object that) { if (that == null) return false; - if (that instanceof get_tables_result) - return this.equals((get_tables_result)that); + if (that instanceof partition_name_to_vals_result) + return this.equals((partition_name_to_vals_result)that); return false; } - public boolean equals(get_tables_result that) { + public boolean equals(partition_name_to_vals_result that) { if (that == null) return false; @@ -10510,13 +23418,13 @@ case SUCCESS: if (field.type == TType.LIST) { { - TList _list79 = iprot.readListBegin(); - this.success = new ArrayList(_list79.size); - for (int _i80 = 0; _i80 < _list79.size; ++_i80) + TList _list166 = iprot.readListBegin(); + this.success = new ArrayList(_list166.size); + for (int _i167 = 0; _i167 < _list166.size; ++_i167) { - String _elem81; - _elem81 = iprot.readString(); - this.success.add(_elem81); + String _elem168; + _elem168 = iprot.readString(); + this.success.add(_elem168); } iprot.readListEnd(); } @@ -10550,8 +23458,8 @@ oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeListBegin(new TList(TType.STRING, this.success.size())); - for (String _iter82 : this.success) { - oprot.writeString(_iter82); + for (String _iter169 : this.success) { + oprot.writeString(_iter169); } oprot.writeListEnd(); } @@ -10567,7 +23475,7 @@ @Override public String toString() { - StringBuilder sb = new StringBuilder("get_tables_result("); + StringBuilder sb = new StringBuilder("partition_name_to_vals_result("); boolean first = true; sb.append("success:"); @@ -10596,74 +23504,74 @@ } - public static class get_all_tables_args implements TBase, java.io.Serializable, Cloneable { - private static final TStruct STRUCT_DESC = new TStruct("get_all_tables_args"); - private static final TField DB_NAME_FIELD_DESC = new TField("db_name", TType.STRING, (short)1); + public static class partition_name_to_spec_args implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("partition_name_to_spec_args"); + private static final TField PART_NAME_FIELD_DESC = new TField("part_name", TType.STRING, (short)1); - private String db_name; - public static final int DB_NAME = 1; + private String part_name; + public static final int PART_NAME = 1; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { } public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ - put(DB_NAME, new FieldMetaData("db_name", TFieldRequirementType.DEFAULT, + put(PART_NAME, new FieldMetaData("part_name", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRING))); }}); static { - FieldMetaData.addStructMetaDataMap(get_all_tables_args.class, metaDataMap); + FieldMetaData.addStructMetaDataMap(partition_name_to_spec_args.class, metaDataMap); } - public get_all_tables_args() { + public partition_name_to_spec_args() { } - public get_all_tables_args( - String db_name) + public partition_name_to_spec_args( + String part_name) { this(); - this.db_name = db_name; + this.part_name = part_name; } /** * Performs a deep copy on other. */ - public get_all_tables_args(get_all_tables_args other) { - if (other.isSetDb_name()) { - this.db_name = other.db_name; + public partition_name_to_spec_args(partition_name_to_spec_args other) { + if (other.isSetPart_name()) { + this.part_name = other.part_name; } } @Override - public get_all_tables_args clone() { - return new get_all_tables_args(this); + public partition_name_to_spec_args clone() { + return new partition_name_to_spec_args(this); } - public String getDb_name() { - return this.db_name; + public String getPart_name() { + return this.part_name; } - public void setDb_name(String db_name) { - this.db_name = db_name; + public void setPart_name(String part_name) { + this.part_name = part_name; } - public void unsetDb_name() { - this.db_name = null; + public void unsetPart_name() { + this.part_name = null; } - // Returns true if field db_name is set (has been asigned a value) and false otherwise - public boolean isSetDb_name() { - return this.db_name != null; + // Returns true if field part_name is set (has been asigned a value) and false otherwise + public boolean isSetPart_name() { + return this.part_name != null; } public void setFieldValue(int fieldID, Object value) { switch (fieldID) { - case DB_NAME: + case PART_NAME: if (value == null) { - unsetDb_name(); + unsetPart_name(); } else { - setDb_name((String)value); + setPart_name((String)value); } break; @@ -10674,8 +23582,8 @@ public Object getFieldValue(int fieldID) { switch (fieldID) { - case DB_NAME: - return getDb_name(); + case PART_NAME: + return getPart_name(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); @@ -10685,8 +23593,8 @@ // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise public boolean isSet(int fieldID) { switch (fieldID) { - case DB_NAME: - return isSetDb_name(); + case PART_NAME: + return isSetPart_name(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -10696,21 +23604,21 @@ public boolean equals(Object that) { if (that == null) return false; - if (that instanceof get_all_tables_args) - return this.equals((get_all_tables_args)that); + if (that instanceof partition_name_to_spec_args) + return this.equals((partition_name_to_spec_args)that); return false; } - public boolean equals(get_all_tables_args that) { + public boolean equals(partition_name_to_spec_args that) { if (that == null) 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) { - if (!(this_present_db_name && that_present_db_name)) + boolean this_present_part_name = true && this.isSetPart_name(); + boolean that_present_part_name = true && that.isSetPart_name(); + if (this_present_part_name || that_present_part_name) { + if (!(this_present_part_name && that_present_part_name)) return false; - if (!this.db_name.equals(that.db_name)) + if (!this.part_name.equals(that.part_name)) return false; } @@ -10733,9 +23641,9 @@ } switch (field.id) { - case DB_NAME: + case PART_NAME: if (field.type == TType.STRING) { - this.db_name = iprot.readString(); + this.part_name = iprot.readString(); } else { TProtocolUtil.skip(iprot, field.type); } @@ -10755,9 +23663,9 @@ validate(); oprot.writeStructBegin(STRUCT_DESC); - if (this.db_name != null) { - oprot.writeFieldBegin(DB_NAME_FIELD_DESC); - oprot.writeString(this.db_name); + if (this.part_name != null) { + oprot.writeFieldBegin(PART_NAME_FIELD_DESC); + oprot.writeString(this.part_name); oprot.writeFieldEnd(); } oprot.writeFieldStop(); @@ -10766,14 +23674,14 @@ @Override public String toString() { - StringBuilder sb = new StringBuilder("get_all_tables_args("); + StringBuilder sb = new StringBuilder("partition_name_to_spec_args("); boolean first = true; - sb.append("db_name:"); - if (this.db_name == null) { + sb.append("part_name:"); + if (this.part_name == null) { sb.append("null"); } else { - sb.append(this.db_name); + sb.append(this.part_name); } first = false; sb.append(")"); @@ -10787,12 +23695,12 @@ } - public static class get_all_tables_result implements TBase, java.io.Serializable, Cloneable { - private static final TStruct STRUCT_DESC = new TStruct("get_all_tables_result"); - private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.LIST, (short)0); + public static class partition_name_to_spec_result implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("partition_name_to_spec_result"); + private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.MAP, (short)0); private static final TField O1_FIELD_DESC = new TField("o1", TType.STRUCT, (short)1); - private List success; + private Map success; public static final int SUCCESS = 0; private MetaException o1; public static final int O1 = 1; @@ -10803,21 +23711,22 @@ public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ put(SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, - new ListMetaData(TType.LIST, + new MapMetaData(TType.MAP, + new FieldValueMetaData(TType.STRING), new FieldValueMetaData(TType.STRING)))); put(O1, new FieldMetaData("o1", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRUCT))); }}); static { - FieldMetaData.addStructMetaDataMap(get_all_tables_result.class, metaDataMap); + FieldMetaData.addStructMetaDataMap(partition_name_to_spec_result.class, metaDataMap); } - public get_all_tables_result() { + public partition_name_to_spec_result() { } - public get_all_tables_result( - List success, + public partition_name_to_spec_result( + Map success, MetaException o1) { this(); @@ -10828,11 +23737,19 @@ /** * Performs a deep copy on other. */ - public get_all_tables_result(get_all_tables_result other) { + public partition_name_to_spec_result(partition_name_to_spec_result other) { if (other.isSetSuccess()) { - List __this__success = new ArrayList(); - for (String other_element : other.success) { - __this__success.add(other_element); + Map __this__success = new HashMap(); + for (Map.Entry other_element : other.success.entrySet()) { + + String other_element_key = other_element.getKey(); + String other_element_value = other_element.getValue(); + + String __this__success_copy_key = other_element_key; + + String __this__success_copy_value = other_element_value; + + __this__success.put(__this__success_copy_key, __this__success_copy_value); } this.success = __this__success; } @@ -10842,30 +23759,26 @@ } @Override - public get_all_tables_result clone() { - return new get_all_tables_result(this); + public partition_name_to_spec_result clone() { + return new partition_name_to_spec_result(this); } public int getSuccessSize() { return (this.success == null) ? 0 : this.success.size(); } - public java.util.Iterator getSuccessIterator() { - return (this.success == null) ? null : this.success.iterator(); - } - - public void addToSuccess(String elem) { + public void putToSuccess(String key, String val) { if (this.success == null) { - this.success = new ArrayList(); + this.success = new HashMap(); } - this.success.add(elem); + this.success.put(key, val); } - public List getSuccess() { + public Map getSuccess() { return this.success; } - public void setSuccess(List success) { + public void setSuccess(Map success) { this.success = success; } @@ -10901,7 +23814,7 @@ if (value == null) { unsetSuccess(); } else { - setSuccess((List)value); + setSuccess((Map)value); } break; @@ -10947,12 +23860,12 @@ public boolean equals(Object that) { if (that == null) return false; - if (that instanceof get_all_tables_result) - return this.equals((get_all_tables_result)that); + if (that instanceof partition_name_to_spec_result) + return this.equals((partition_name_to_spec_result)that); return false; } - public boolean equals(get_all_tables_result that) { + public boolean equals(partition_name_to_spec_result that) { if (that == null) return false; @@ -10994,17 +23907,19 @@ switch (field.id) { case SUCCESS: - if (field.type == TType.LIST) { + if (field.type == TType.MAP) { { - TList _list83 = iprot.readListBegin(); - this.success = new ArrayList(_list83.size); - for (int _i84 = 0; _i84 < _list83.size; ++_i84) + TMap _map170 = iprot.readMapBegin(); + this.success = new HashMap(2*_map170.size); + for (int _i171 = 0; _i171 < _map170.size; ++_i171) { - String _elem85; - _elem85 = iprot.readString(); - this.success.add(_elem85); + String _key172; + String _val173; + _key172 = iprot.readString(); + _val173 = iprot.readString(); + this.success.put(_key172, _val173); } - iprot.readListEnd(); + iprot.readMapEnd(); } } else { TProtocolUtil.skip(iprot, field.type); @@ -11035,11 +23950,12 @@ if (this.isSetSuccess()) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { - oprot.writeListBegin(new TList(TType.STRING, this.success.size())); - for (String _iter86 : this.success) { - oprot.writeString(_iter86); + oprot.writeMapBegin(new TMap(TType.STRING, TType.STRING, this.success.size())); + for (Map.Entry _iter174 : this.success.entrySet()) { + oprot.writeString(_iter174.getKey()); + oprot.writeString(_iter174.getValue()); } - oprot.writeListEnd(); + oprot.writeMapEnd(); } oprot.writeFieldEnd(); } else if (this.isSetO1()) { @@ -11053,7 +23969,7 @@ @Override public String toString() { - StringBuilder sb = new StringBuilder("get_all_tables_result("); + StringBuilder sb = new StringBuilder("partition_name_to_spec_result("); boolean first = true; sb.append("success:"); @@ -11082,109 +23998,109 @@ } - public static class get_table_args implements TBase, java.io.Serializable, Cloneable { - private static final TStruct STRUCT_DESC = new TStruct("get_table_args"); - private static final TField DBNAME_FIELD_DESC = new TField("dbname", TType.STRING, (short)1); - private static final TField TBL_NAME_FIELD_DESC = new TField("tbl_name", TType.STRING, (short)2); + public static class add_index_args implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("add_index_args"); + private static final TField NEW_INDEX_FIELD_DESC = new TField("new_index", TType.STRUCT, (short)1); + private static final TField INDEX_TABLE_FIELD_DESC = new TField("index_table", TType.STRUCT, (short)2); - private String dbname; - public static final int DBNAME = 1; - private String tbl_name; - public static final int TBL_NAME = 2; + private Index new_index; + public static final int NEW_INDEX = 1; + private Table index_table; + public static final int INDEX_TABLE = 2; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { } public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ - put(DBNAME, new FieldMetaData("dbname", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRING))); - put(TBL_NAME, new FieldMetaData("tbl_name", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRING))); + put(NEW_INDEX, new FieldMetaData("new_index", TFieldRequirementType.DEFAULT, + new StructMetaData(TType.STRUCT, Index.class))); + put(INDEX_TABLE, new FieldMetaData("index_table", TFieldRequirementType.DEFAULT, + new StructMetaData(TType.STRUCT, Table.class))); }}); static { - FieldMetaData.addStructMetaDataMap(get_table_args.class, metaDataMap); + FieldMetaData.addStructMetaDataMap(add_index_args.class, metaDataMap); } - public get_table_args() { + public add_index_args() { } - public get_table_args( - String dbname, - String tbl_name) + public add_index_args( + Index new_index, + Table index_table) { this(); - this.dbname = dbname; - this.tbl_name = tbl_name; + this.new_index = new_index; + this.index_table = index_table; } /** * Performs a deep copy on other. */ - public get_table_args(get_table_args other) { - if (other.isSetDbname()) { - this.dbname = other.dbname; + public add_index_args(add_index_args other) { + if (other.isSetNew_index()) { + this.new_index = new Index(other.new_index); } - if (other.isSetTbl_name()) { - this.tbl_name = other.tbl_name; + if (other.isSetIndex_table()) { + this.index_table = new Table(other.index_table); } } @Override - public get_table_args clone() { - return new get_table_args(this); + public add_index_args clone() { + return new add_index_args(this); } - public String getDbname() { - return this.dbname; + public Index getNew_index() { + return this.new_index; } - public void setDbname(String dbname) { - this.dbname = dbname; + public void setNew_index(Index new_index) { + this.new_index = new_index; } - public void unsetDbname() { - this.dbname = null; + public void unsetNew_index() { + this.new_index = null; } - // Returns true if field dbname is set (has been asigned a value) and false otherwise - public boolean isSetDbname() { - return this.dbname != null; + // Returns true if field new_index is set (has been asigned a value) and false otherwise + public boolean isSetNew_index() { + return this.new_index != null; } - public String getTbl_name() { - return this.tbl_name; + public Table getIndex_table() { + return this.index_table; } - public void setTbl_name(String tbl_name) { - this.tbl_name = tbl_name; + public void setIndex_table(Table index_table) { + this.index_table = index_table; } - public void unsetTbl_name() { - this.tbl_name = null; + public void unsetIndex_table() { + this.index_table = null; } - // Returns true if field tbl_name is set (has been asigned a value) and false otherwise - public boolean isSetTbl_name() { - return this.tbl_name != null; + // Returns true if field index_table is set (has been asigned a value) and false otherwise + public boolean isSetIndex_table() { + return this.index_table != null; } public void setFieldValue(int fieldID, Object value) { switch (fieldID) { - case DBNAME: + case NEW_INDEX: if (value == null) { - unsetDbname(); + unsetNew_index(); } else { - setDbname((String)value); + setNew_index((Index)value); } break; - case TBL_NAME: + case INDEX_TABLE: if (value == null) { - unsetTbl_name(); + unsetIndex_table(); } else { - setTbl_name((String)value); + setIndex_table((Table)value); } break; @@ -11195,11 +24111,11 @@ public Object getFieldValue(int fieldID) { switch (fieldID) { - case DBNAME: - return getDbname(); + case NEW_INDEX: + return getNew_index(); - case TBL_NAME: - return getTbl_name(); + case INDEX_TABLE: + return getIndex_table(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); @@ -11209,10 +24125,10 @@ // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise public boolean isSet(int fieldID) { switch (fieldID) { - case DBNAME: - return isSetDbname(); - case TBL_NAME: - return isSetTbl_name(); + case NEW_INDEX: + return isSetNew_index(); + case INDEX_TABLE: + return isSetIndex_table(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -11222,30 +24138,30 @@ public boolean equals(Object that) { if (that == null) return false; - if (that instanceof get_table_args) - return this.equals((get_table_args)that); + if (that instanceof add_index_args) + return this.equals((add_index_args)that); return false; } - public boolean equals(get_table_args that) { + public boolean equals(add_index_args that) { if (that == null) return false; - boolean this_present_dbname = true && this.isSetDbname(); - boolean that_present_dbname = true && that.isSetDbname(); - if (this_present_dbname || that_present_dbname) { - if (!(this_present_dbname && that_present_dbname)) + boolean this_present_new_index = true && this.isSetNew_index(); + boolean that_present_new_index = true && that.isSetNew_index(); + if (this_present_new_index || that_present_new_index) { + if (!(this_present_new_index && that_present_new_index)) return false; - if (!this.dbname.equals(that.dbname)) + if (!this.new_index.equals(that.new_index)) return false; } - boolean this_present_tbl_name = true && this.isSetTbl_name(); - boolean that_present_tbl_name = true && that.isSetTbl_name(); - if (this_present_tbl_name || that_present_tbl_name) { - if (!(this_present_tbl_name && that_present_tbl_name)) + boolean this_present_index_table = true && this.isSetIndex_table(); + boolean that_present_index_table = true && that.isSetIndex_table(); + if (this_present_index_table || that_present_index_table) { + if (!(this_present_index_table && that_present_index_table)) return false; - if (!this.tbl_name.equals(that.tbl_name)) + if (!this.index_table.equals(that.index_table)) return false; } @@ -11268,16 +24184,18 @@ } switch (field.id) { - case DBNAME: - if (field.type == TType.STRING) { - this.dbname = iprot.readString(); + case NEW_INDEX: + if (field.type == TType.STRUCT) { + this.new_index = new Index(); + this.new_index.read(iprot); } else { TProtocolUtil.skip(iprot, field.type); } break; - case TBL_NAME: - if (field.type == TType.STRING) { - this.tbl_name = iprot.readString(); + case INDEX_TABLE: + if (field.type == TType.STRUCT) { + this.index_table = new Table(); + this.index_table.read(iprot); } else { TProtocolUtil.skip(iprot, field.type); } @@ -11297,14 +24215,14 @@ validate(); oprot.writeStructBegin(STRUCT_DESC); - if (this.dbname != null) { - oprot.writeFieldBegin(DBNAME_FIELD_DESC); - oprot.writeString(this.dbname); + if (this.new_index != null) { + oprot.writeFieldBegin(NEW_INDEX_FIELD_DESC); + this.new_index.write(oprot); oprot.writeFieldEnd(); } - if (this.tbl_name != null) { - oprot.writeFieldBegin(TBL_NAME_FIELD_DESC); - oprot.writeString(this.tbl_name); + if (this.index_table != null) { + oprot.writeFieldBegin(INDEX_TABLE_FIELD_DESC); + this.index_table.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); @@ -11313,22 +24231,22 @@ @Override public String toString() { - StringBuilder sb = new StringBuilder("get_table_args("); + StringBuilder sb = new StringBuilder("add_index_args("); boolean first = true; - sb.append("dbname:"); - if (this.dbname == null) { + sb.append("new_index:"); + if (this.new_index == null) { sb.append("null"); } else { - sb.append(this.dbname); + sb.append(this.new_index); } first = false; if (!first) sb.append(", "); - sb.append("tbl_name:"); - if (this.tbl_name == null) { + sb.append("index_table:"); + if (this.index_table == null) { sb.append("null"); } else { - sb.append(this.tbl_name); + sb.append(this.index_table); } first = false; sb.append(")"); @@ -11342,18 +24260,21 @@ } - public static class get_table_result implements TBase, java.io.Serializable, Cloneable { - private static final TStruct STRUCT_DESC = new TStruct("get_table_result"); + public static class add_index_result implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("add_index_result"); private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.STRUCT, (short)0); private static final TField O1_FIELD_DESC = new TField("o1", TType.STRUCT, (short)1); private static final TField O2_FIELD_DESC = new TField("o2", TType.STRUCT, (short)2); + private static final TField O3_FIELD_DESC = new TField("o3", TType.STRUCT, (short)3); - private Table success; + private Index success; public static final int SUCCESS = 0; - private MetaException o1; + private InvalidObjectException o1; public static final int O1 = 1; - private NoSuchObjectException o2; + private AlreadyExistsException o2; public static final int O2 = 2; + private MetaException o3; + public static final int O3 = 3; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { @@ -11361,56 +24282,63 @@ public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ put(SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, - new StructMetaData(TType.STRUCT, Table.class))); + new StructMetaData(TType.STRUCT, Index.class))); put(O1, new FieldMetaData("o1", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRUCT))); put(O2, new FieldMetaData("o2", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRUCT))); + put(O3, new FieldMetaData("o3", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRUCT))); }}); static { - FieldMetaData.addStructMetaDataMap(get_table_result.class, metaDataMap); + FieldMetaData.addStructMetaDataMap(add_index_result.class, metaDataMap); } - public get_table_result() { + public add_index_result() { } - public get_table_result( - Table success, - MetaException o1, - NoSuchObjectException o2) + public add_index_result( + Index success, + InvalidObjectException o1, + AlreadyExistsException o2, + MetaException o3) { this(); this.success = success; this.o1 = o1; this.o2 = o2; + this.o3 = o3; } /** * Performs a deep copy on other. */ - public get_table_result(get_table_result other) { + public add_index_result(add_index_result other) { if (other.isSetSuccess()) { - this.success = new Table(other.success); + this.success = new Index(other.success); } if (other.isSetO1()) { - this.o1 = new MetaException(other.o1); + this.o1 = new InvalidObjectException(other.o1); } if (other.isSetO2()) { - this.o2 = new NoSuchObjectException(other.o2); + this.o2 = new AlreadyExistsException(other.o2); + } + if (other.isSetO3()) { + this.o3 = new MetaException(other.o3); } } @Override - public get_table_result clone() { - return new get_table_result(this); + public add_index_result clone() { + return new add_index_result(this); } - public Table getSuccess() { + public Index getSuccess() { return this.success; } - public void setSuccess(Table success) { + public void setSuccess(Index success) { this.success = success; } @@ -11423,11 +24351,11 @@ return this.success != null; } - public MetaException getO1() { + public InvalidObjectException getO1() { return this.o1; } - public void setO1(MetaException o1) { + public void setO1(InvalidObjectException o1) { this.o1 = o1; } @@ -11440,11 +24368,11 @@ return this.o1 != null; } - public NoSuchObjectException getO2() { + public AlreadyExistsException getO2() { return this.o2; } - public void setO2(NoSuchObjectException o2) { + public void setO2(AlreadyExistsException o2) { this.o2 = o2; } @@ -11457,13 +24385,30 @@ return this.o2 != null; } + public MetaException getO3() { + return this.o3; + } + + public void setO3(MetaException o3) { + this.o3 = o3; + } + + public void unsetO3() { + this.o3 = null; + } + + // Returns true if field o3 is set (has been asigned a value) and false otherwise + public boolean isSetO3() { + return this.o3 != null; + } + public void setFieldValue(int fieldID, Object value) { switch (fieldID) { case SUCCESS: if (value == null) { unsetSuccess(); } else { - setSuccess((Table)value); + setSuccess((Index)value); } break; @@ -11471,7 +24416,7 @@ if (value == null) { unsetO1(); } else { - setO1((MetaException)value); + setO1((InvalidObjectException)value); } break; @@ -11479,7 +24424,15 @@ if (value == null) { unsetO2(); } else { - setO2((NoSuchObjectException)value); + setO2((AlreadyExistsException)value); + } + break; + + case O3: + if (value == null) { + unsetO3(); + } else { + setO3((MetaException)value); } break; @@ -11499,6 +24452,9 @@ case O2: return getO2(); + case O3: + return getO3(); + default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -11513,6 +24469,8 @@ return isSetO1(); case O2: return isSetO2(); + case O3: + return isSetO3(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -11522,12 +24480,12 @@ public boolean equals(Object that) { if (that == null) return false; - if (that instanceof get_table_result) - return this.equals((get_table_result)that); + if (that instanceof add_index_result) + return this.equals((add_index_result)that); return false; } - public boolean equals(get_table_result that) { + public boolean equals(add_index_result that) { if (that == null) return false; @@ -11558,6 +24516,15 @@ return false; } + boolean this_present_o3 = true && this.isSetO3(); + boolean that_present_o3 = true && that.isSetO3(); + if (this_present_o3 || that_present_o3) { + if (!(this_present_o3 && that_present_o3)) + return false; + if (!this.o3.equals(that.o3)) + return false; + } + return true; } @@ -11579,7 +24546,7 @@ { case SUCCESS: if (field.type == TType.STRUCT) { - this.success = new Table(); + this.success = new Index(); this.success.read(iprot); } else { TProtocolUtil.skip(iprot, field.type); @@ -11587,7 +24554,7 @@ break; case O1: if (field.type == TType.STRUCT) { - this.o1 = new MetaException(); + this.o1 = new InvalidObjectException(); this.o1.read(iprot); } else { TProtocolUtil.skip(iprot, field.type); @@ -11595,12 +24562,20 @@ break; case O2: if (field.type == TType.STRUCT) { - this.o2 = new NoSuchObjectException(); + this.o2 = new AlreadyExistsException(); this.o2.read(iprot); } else { TProtocolUtil.skip(iprot, field.type); } break; + case O3: + if (field.type == TType.STRUCT) { + this.o3 = new MetaException(); + this.o3.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; default: TProtocolUtil.skip(iprot, field.type); break; @@ -11627,6 +24602,10 @@ oprot.writeFieldBegin(O2_FIELD_DESC); this.o2.write(oprot); oprot.writeFieldEnd(); + } else if (this.isSetO3()) { + oprot.writeFieldBegin(O3_FIELD_DESC); + this.o3.write(oprot); + oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); @@ -11634,7 +24613,7 @@ @Override public String toString() { - StringBuilder sb = new StringBuilder("get_table_result("); + StringBuilder sb = new StringBuilder("add_index_result("); boolean first = true; sb.append("success:"); @@ -11660,6 +24639,14 @@ sb.append(this.o2); } first = false; + if (!first) sb.append(", "); + sb.append("o3:"); + if (this.o3 == null) { + sb.append("null"); + } else { + sb.append(this.o3); + } + first = false; sb.append(")"); return sb.toString(); } @@ -11671,85 +24658,96 @@ } - public static class alter_table_args implements TBase, java.io.Serializable, Cloneable { - private static final TStruct STRUCT_DESC = new TStruct("alter_table_args"); - private static final TField DBNAME_FIELD_DESC = new TField("dbname", TType.STRING, (short)1); + public static class drop_index_by_name_args implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("drop_index_by_name_args"); + private static final TField DB_NAME_FIELD_DESC = new TField("db_name", TType.STRING, (short)1); private static final TField TBL_NAME_FIELD_DESC = new TField("tbl_name", TType.STRING, (short)2); - private static final TField NEW_TBL_FIELD_DESC = new TField("new_tbl", TType.STRUCT, (short)3); + private static final TField INDEX_NAME_FIELD_DESC = new TField("index_name", TType.STRING, (short)3); + private static final TField DELETE_DATA_FIELD_DESC = new TField("deleteData", TType.BOOL, (short)4); - private String dbname; - public static final int DBNAME = 1; + private String db_name; + public static final int DB_NAME = 1; private String tbl_name; public static final int TBL_NAME = 2; - private Table new_tbl; - public static final int NEW_TBL = 3; + private String index_name; + public static final int INDEX_NAME = 3; + private boolean deleteData; + public static final int DELETEDATA = 4; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { + public boolean deleteData = false; } public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ - put(DBNAME, new FieldMetaData("dbname", TFieldRequirementType.DEFAULT, + put(DB_NAME, new FieldMetaData("db_name", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRING))); put(TBL_NAME, new FieldMetaData("tbl_name", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRING))); - put(NEW_TBL, new FieldMetaData("new_tbl", TFieldRequirementType.DEFAULT, - new StructMetaData(TType.STRUCT, Table.class))); + put(INDEX_NAME, new FieldMetaData("index_name", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + put(DELETEDATA, new FieldMetaData("deleteData", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.BOOL))); }}); static { - FieldMetaData.addStructMetaDataMap(alter_table_args.class, metaDataMap); + FieldMetaData.addStructMetaDataMap(drop_index_by_name_args.class, metaDataMap); } - public alter_table_args() { + public drop_index_by_name_args() { } - public alter_table_args( - String dbname, + public drop_index_by_name_args( + String db_name, String tbl_name, - Table new_tbl) + String index_name, + boolean deleteData) { this(); - this.dbname = dbname; + this.db_name = db_name; this.tbl_name = tbl_name; - this.new_tbl = new_tbl; + this.index_name = index_name; + this.deleteData = deleteData; + this.__isset.deleteData = true; } /** * Performs a deep copy on other. */ - public alter_table_args(alter_table_args other) { - if (other.isSetDbname()) { - this.dbname = other.dbname; + public drop_index_by_name_args(drop_index_by_name_args other) { + if (other.isSetDb_name()) { + this.db_name = other.db_name; } if (other.isSetTbl_name()) { this.tbl_name = other.tbl_name; } - if (other.isSetNew_tbl()) { - this.new_tbl = new Table(other.new_tbl); + if (other.isSetIndex_name()) { + this.index_name = other.index_name; } + __isset.deleteData = other.__isset.deleteData; + this.deleteData = other.deleteData; } @Override - public alter_table_args clone() { - return new alter_table_args(this); + public drop_index_by_name_args clone() { + return new drop_index_by_name_args(this); } - public String getDbname() { - return this.dbname; + public String getDb_name() { + return this.db_name; } - public void setDbname(String dbname) { - this.dbname = dbname; + public void setDb_name(String db_name) { + this.db_name = db_name; } - public void unsetDbname() { - this.dbname = null; + public void unsetDb_name() { + this.db_name = null; } - // Returns true if field dbname is set (has been asigned a value) and false otherwise - public boolean isSetDbname() { - return this.dbname != null; + // Returns true if field db_name is set (has been asigned a value) and false otherwise + public boolean isSetDb_name() { + return this.db_name != null; } public String getTbl_name() { @@ -11769,30 +24767,48 @@ return this.tbl_name != null; } - public Table getNew_tbl() { - return this.new_tbl; + public String getIndex_name() { + return this.index_name; } - public void setNew_tbl(Table new_tbl) { - this.new_tbl = new_tbl; + public void setIndex_name(String index_name) { + this.index_name = index_name; } - public void unsetNew_tbl() { - this.new_tbl = null; + public void unsetIndex_name() { + this.index_name = null; } - // Returns true if field new_tbl is set (has been asigned a value) and false otherwise - public boolean isSetNew_tbl() { - return this.new_tbl != null; + // Returns true if field index_name is set (has been asigned a value) and false otherwise + public boolean isSetIndex_name() { + return this.index_name != null; + } + + public boolean isDeleteData() { + return this.deleteData; + } + + public void setDeleteData(boolean deleteData) { + this.deleteData = deleteData; + this.__isset.deleteData = true; + } + + public void unsetDeleteData() { + this.__isset.deleteData = false; + } + + // Returns true if field deleteData is set (has been asigned a value) and false otherwise + public boolean isSetDeleteData() { + return this.__isset.deleteData; } public void setFieldValue(int fieldID, Object value) { switch (fieldID) { - case DBNAME: + case DB_NAME: if (value == null) { - unsetDbname(); + unsetDb_name(); } else { - setDbname((String)value); + setDb_name((String)value); } break; @@ -11804,11 +24820,19 @@ } break; - case NEW_TBL: + case INDEX_NAME: if (value == null) { - unsetNew_tbl(); + unsetIndex_name(); } else { - setNew_tbl((Table)value); + setIndex_name((String)value); + } + break; + + case DELETEDATA: + if (value == null) { + unsetDeleteData(); + } else { + setDeleteData((Boolean)value); } break; @@ -11819,14 +24843,17 @@ public Object getFieldValue(int fieldID) { switch (fieldID) { - case DBNAME: - return getDbname(); + case DB_NAME: + return getDb_name(); case TBL_NAME: return getTbl_name(); - case NEW_TBL: - return getNew_tbl(); + case INDEX_NAME: + return getIndex_name(); + + case DELETEDATA: + return new Boolean(isDeleteData()); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); @@ -11836,12 +24863,14 @@ // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise public boolean isSet(int fieldID) { switch (fieldID) { - case DBNAME: - return isSetDbname(); + case DB_NAME: + return isSetDb_name(); case TBL_NAME: return isSetTbl_name(); - case NEW_TBL: - return isSetNew_tbl(); + case INDEX_NAME: + return isSetIndex_name(); + case DELETEDATA: + return isSetDeleteData(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -11851,21 +24880,21 @@ public boolean equals(Object that) { if (that == null) return false; - if (that instanceof alter_table_args) - return this.equals((alter_table_args)that); + if (that instanceof drop_index_by_name_args) + return this.equals((drop_index_by_name_args)that); return false; } - public boolean equals(alter_table_args that) { + public boolean equals(drop_index_by_name_args that) { if (that == null) return false; - boolean this_present_dbname = true && this.isSetDbname(); - boolean that_present_dbname = true && that.isSetDbname(); - if (this_present_dbname || that_present_dbname) { - if (!(this_present_dbname && that_present_dbname)) + 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) { + if (!(this_present_db_name && that_present_db_name)) return false; - if (!this.dbname.equals(that.dbname)) + if (!this.db_name.equals(that.db_name)) return false; } @@ -11878,12 +24907,21 @@ return false; } - boolean this_present_new_tbl = true && this.isSetNew_tbl(); - boolean that_present_new_tbl = true && that.isSetNew_tbl(); - if (this_present_new_tbl || that_present_new_tbl) { - if (!(this_present_new_tbl && that_present_new_tbl)) + boolean this_present_index_name = true && this.isSetIndex_name(); + boolean that_present_index_name = true && that.isSetIndex_name(); + if (this_present_index_name || that_present_index_name) { + if (!(this_present_index_name && that_present_index_name)) return false; - if (!this.new_tbl.equals(that.new_tbl)) + if (!this.index_name.equals(that.index_name)) + return false; + } + + boolean this_present_deleteData = true; + boolean that_present_deleteData = true; + if (this_present_deleteData || that_present_deleteData) { + if (!(this_present_deleteData && that_present_deleteData)) + return false; + if (this.deleteData != that.deleteData) return false; } @@ -11906,9 +24944,9 @@ } switch (field.id) { - case DBNAME: + case DB_NAME: if (field.type == TType.STRING) { - this.dbname = iprot.readString(); + this.db_name = iprot.readString(); } else { TProtocolUtil.skip(iprot, field.type); } @@ -11920,10 +24958,17 @@ TProtocolUtil.skip(iprot, field.type); } break; - case NEW_TBL: - if (field.type == TType.STRUCT) { - this.new_tbl = new Table(); - this.new_tbl.read(iprot); + case INDEX_NAME: + if (field.type == TType.STRING) { + this.index_name = iprot.readString(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case DELETEDATA: + if (field.type == TType.BOOL) { + this.deleteData = iprot.readBool(); + this.__isset.deleteData = true; } else { TProtocolUtil.skip(iprot, field.type); } @@ -11943,9 +24988,9 @@ validate(); oprot.writeStructBegin(STRUCT_DESC); - if (this.dbname != null) { - oprot.writeFieldBegin(DBNAME_FIELD_DESC); - oprot.writeString(this.dbname); + if (this.db_name != null) { + oprot.writeFieldBegin(DB_NAME_FIELD_DESC); + oprot.writeString(this.db_name); oprot.writeFieldEnd(); } if (this.tbl_name != null) { @@ -11953,25 +24998,28 @@ oprot.writeString(this.tbl_name); oprot.writeFieldEnd(); } - if (this.new_tbl != null) { - oprot.writeFieldBegin(NEW_TBL_FIELD_DESC); - this.new_tbl.write(oprot); + if (this.index_name != null) { + oprot.writeFieldBegin(INDEX_NAME_FIELD_DESC); + oprot.writeString(this.index_name); oprot.writeFieldEnd(); } + oprot.writeFieldBegin(DELETE_DATA_FIELD_DESC); + oprot.writeBool(this.deleteData); + oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } @Override public String toString() { - StringBuilder sb = new StringBuilder("alter_table_args("); + StringBuilder sb = new StringBuilder("drop_index_by_name_args("); boolean first = true; - sb.append("dbname:"); - if (this.dbname == null) { + sb.append("db_name:"); + if (this.db_name == null) { sb.append("null"); } else { - sb.append(this.dbname); + sb.append(this.db_name); } first = false; if (!first) sb.append(", "); @@ -11983,13 +25031,17 @@ } first = false; if (!first) sb.append(", "); - sb.append("new_tbl:"); - if (this.new_tbl == null) { + sb.append("index_name:"); + if (this.index_name == null) { sb.append("null"); } else { - sb.append(this.new_tbl); + sb.append(this.index_name); } first = false; + if (!first) sb.append(", "); + sb.append("deleteData:"); + sb.append(this.deleteData); + first = false; sb.append(")"); return sb.toString(); } @@ -12001,21 +25053,27 @@ } - public static class alter_table_result implements TBase, java.io.Serializable, Cloneable { - private static final TStruct STRUCT_DESC = new TStruct("alter_table_result"); + public static class drop_index_by_name_result implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("drop_index_by_name_result"); + private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.BOOL, (short)0); private static final TField O1_FIELD_DESC = new TField("o1", TType.STRUCT, (short)1); private static final TField O2_FIELD_DESC = new TField("o2", TType.STRUCT, (short)2); - private InvalidOperationException o1; + private boolean success; + public static final int SUCCESS = 0; + private NoSuchObjectException o1; public static final int O1 = 1; private MetaException o2; public static final int O2 = 2; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { + public boolean success = false; } public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ + put(SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.BOOL))); put(O1, new FieldMetaData("o1", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRUCT))); put(O2, new FieldMetaData("o2", TFieldRequirementType.DEFAULT, @@ -12023,17 +25081,20 @@ }}); static { - FieldMetaData.addStructMetaDataMap(alter_table_result.class, metaDataMap); + FieldMetaData.addStructMetaDataMap(drop_index_by_name_result.class, metaDataMap); } - public alter_table_result() { + public drop_index_by_name_result() { } - public alter_table_result( - InvalidOperationException o1, + public drop_index_by_name_result( + boolean success, + NoSuchObjectException o1, MetaException o2) { this(); + this.success = success; + this.__isset.success = true; this.o1 = o1; this.o2 = o2; } @@ -12041,9 +25102,11 @@ /** * Performs a deep copy on other. */ - public alter_table_result(alter_table_result other) { + public drop_index_by_name_result(drop_index_by_name_result other) { + __isset.success = other.__isset.success; + this.success = other.success; if (other.isSetO1()) { - this.o1 = new InvalidOperationException(other.o1); + this.o1 = new NoSuchObjectException(other.o1); } if (other.isSetO2()) { this.o2 = new MetaException(other.o2); @@ -12051,15 +25114,33 @@ } @Override - public alter_table_result clone() { - return new alter_table_result(this); + public drop_index_by_name_result clone() { + return new drop_index_by_name_result(this); } - public InvalidOperationException getO1() { + public boolean isSuccess() { + return this.success; + } + + public void setSuccess(boolean success) { + this.success = success; + this.__isset.success = true; + } + + public void unsetSuccess() { + this.__isset.success = false; + } + + // Returns true if field success is set (has been asigned a value) and false otherwise + public boolean isSetSuccess() { + return this.__isset.success; + } + + public NoSuchObjectException getO1() { return this.o1; } - public void setO1(InvalidOperationException o1) { + public void setO1(NoSuchObjectException o1) { this.o1 = o1; } @@ -12091,11 +25172,19 @@ public void setFieldValue(int fieldID, Object value) { switch (fieldID) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((Boolean)value); + } + break; + case O1: if (value == null) { unsetO1(); } else { - setO1((InvalidOperationException)value); + setO1((NoSuchObjectException)value); } break; @@ -12114,6 +25203,9 @@ public Object getFieldValue(int fieldID) { switch (fieldID) { + case SUCCESS: + return new Boolean(isSuccess()); + case O1: return getO1(); @@ -12128,6 +25220,8 @@ // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise public boolean isSet(int fieldID) { switch (fieldID) { + case SUCCESS: + return isSetSuccess(); case O1: return isSetO1(); case O2: @@ -12141,15 +25235,24 @@ public boolean equals(Object that) { if (that == null) return false; - if (that instanceof alter_table_result) - return this.equals((alter_table_result)that); + if (that instanceof drop_index_by_name_result) + return this.equals((drop_index_by_name_result)that); return false; } - public boolean equals(alter_table_result that) { + public boolean equals(drop_index_by_name_result that) { if (that == null) return false; + boolean this_present_success = true; + boolean that_present_success = true; + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (this.success != that.success) + return false; + } + boolean this_present_o1 = true && this.isSetO1(); boolean that_present_o1 = true && that.isSetO1(); if (this_present_o1 || that_present_o1) { @@ -12187,9 +25290,17 @@ } switch (field.id) { + case SUCCESS: + if (field.type == TType.BOOL) { + this.success = iprot.readBool(); + this.__isset.success = true; + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; case O1: if (field.type == TType.STRUCT) { - this.o1 = new InvalidOperationException(); + this.o1 = new NoSuchObjectException(); this.o1.read(iprot); } else { TProtocolUtil.skip(iprot, field.type); @@ -12217,7 +25328,11 @@ public void write(TProtocol oprot) throws TException { oprot.writeStructBegin(STRUCT_DESC); - if (this.isSetO1()) { + if (this.isSetSuccess()) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + oprot.writeBool(this.success); + oprot.writeFieldEnd(); + } else if (this.isSetO1()) { oprot.writeFieldBegin(O1_FIELD_DESC); this.o1.write(oprot); oprot.writeFieldEnd(); @@ -12232,9 +25347,13 @@ @Override public String toString() { - StringBuilder sb = new StringBuilder("alter_table_result("); + StringBuilder sb = new StringBuilder("drop_index_by_name_result("); boolean first = true; + sb.append("success:"); + sb.append(this.success); + first = false; + if (!first) sb.append(", "); sb.append("o1:"); if (this.o1 == null) { sb.append("null"); @@ -12261,74 +25380,144 @@ } - public static class add_partition_args implements TBase, java.io.Serializable, Cloneable { - private static final TStruct STRUCT_DESC = new TStruct("add_partition_args"); - private static final TField NEW_PART_FIELD_DESC = new TField("new_part", TType.STRUCT, (short)1); + public static class get_index_by_name_args implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("get_index_by_name_args"); + private static final TField DB_NAME_FIELD_DESC = new TField("db_name", TType.STRING, (short)1); + private static final TField TBL_NAME_FIELD_DESC = new TField("tbl_name", TType.STRING, (short)2); + private static final TField INDEX_NAME_FIELD_DESC = new TField("index_name", TType.STRING, (short)3); - private Partition new_part; - public static final int NEW_PART = 1; + private String db_name; + public static final int DB_NAME = 1; + private String tbl_name; + public static final int TBL_NAME = 2; + private String index_name; + public static final int INDEX_NAME = 3; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { } public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ - put(NEW_PART, new FieldMetaData("new_part", TFieldRequirementType.DEFAULT, - new StructMetaData(TType.STRUCT, Partition.class))); + put(DB_NAME, new FieldMetaData("db_name", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + put(TBL_NAME, new FieldMetaData("tbl_name", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + put(INDEX_NAME, new FieldMetaData("index_name", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); }}); static { - FieldMetaData.addStructMetaDataMap(add_partition_args.class, metaDataMap); + FieldMetaData.addStructMetaDataMap(get_index_by_name_args.class, metaDataMap); } - public add_partition_args() { + public get_index_by_name_args() { } - public add_partition_args( - Partition new_part) + public get_index_by_name_args( + String db_name, + String tbl_name, + String index_name) { this(); - this.new_part = new_part; + this.db_name = db_name; + this.tbl_name = tbl_name; + this.index_name = index_name; } /** * Performs a deep copy on other. */ - public add_partition_args(add_partition_args other) { - if (other.isSetNew_part()) { - this.new_part = new Partition(other.new_part); + public get_index_by_name_args(get_index_by_name_args other) { + if (other.isSetDb_name()) { + this.db_name = other.db_name; + } + if (other.isSetTbl_name()) { + this.tbl_name = other.tbl_name; + } + if (other.isSetIndex_name()) { + this.index_name = other.index_name; } } @Override - public add_partition_args clone() { - return new add_partition_args(this); + public get_index_by_name_args clone() { + return new get_index_by_name_args(this); } - public Partition getNew_part() { - return this.new_part; + public String getDb_name() { + return this.db_name; } - public void setNew_part(Partition new_part) { - this.new_part = new_part; + public void setDb_name(String db_name) { + this.db_name = db_name; } - public void unsetNew_part() { - this.new_part = null; + public void unsetDb_name() { + this.db_name = null; } - // Returns true if field new_part is set (has been asigned a value) and false otherwise - public boolean isSetNew_part() { - return this.new_part != null; + // Returns true if field db_name is set (has been asigned a value) and false otherwise + public boolean isSetDb_name() { + return this.db_name != null; + } + + public String getTbl_name() { + return this.tbl_name; + } + + public void setTbl_name(String tbl_name) { + this.tbl_name = tbl_name; + } + + public void unsetTbl_name() { + this.tbl_name = null; + } + + // Returns true if field tbl_name is set (has been asigned a value) and false otherwise + public boolean isSetTbl_name() { + return this.tbl_name != null; + } + + public String getIndex_name() { + return this.index_name; + } + + public void setIndex_name(String index_name) { + this.index_name = index_name; + } + + public void unsetIndex_name() { + this.index_name = null; + } + + // Returns true if field index_name is set (has been asigned a value) and false otherwise + public boolean isSetIndex_name() { + return this.index_name != null; } public void setFieldValue(int fieldID, Object value) { switch (fieldID) { - case NEW_PART: + case DB_NAME: if (value == null) { - unsetNew_part(); + unsetDb_name(); } else { - setNew_part((Partition)value); + setDb_name((String)value); + } + break; + + case TBL_NAME: + if (value == null) { + unsetTbl_name(); + } else { + setTbl_name((String)value); + } + break; + + case INDEX_NAME: + if (value == null) { + unsetIndex_name(); + } else { + setIndex_name((String)value); } break; @@ -12339,8 +25528,14 @@ public Object getFieldValue(int fieldID) { switch (fieldID) { - case NEW_PART: - return getNew_part(); + case DB_NAME: + return getDb_name(); + + case TBL_NAME: + return getTbl_name(); + + case INDEX_NAME: + return getIndex_name(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); @@ -12350,8 +25545,12 @@ // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise public boolean isSet(int fieldID) { switch (fieldID) { - case NEW_PART: - return isSetNew_part(); + case DB_NAME: + return isSetDb_name(); + case TBL_NAME: + return isSetTbl_name(); + case INDEX_NAME: + return isSetIndex_name(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -12361,21 +25560,39 @@ public boolean equals(Object that) { if (that == null) return false; - if (that instanceof add_partition_args) - return this.equals((add_partition_args)that); + if (that instanceof get_index_by_name_args) + return this.equals((get_index_by_name_args)that); return false; } - public boolean equals(add_partition_args that) { + public boolean equals(get_index_by_name_args that) { if (that == null) return false; - boolean this_present_new_part = true && this.isSetNew_part(); - boolean that_present_new_part = true && that.isSetNew_part(); - if (this_present_new_part || that_present_new_part) { - if (!(this_present_new_part && that_present_new_part)) + 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) { + if (!(this_present_db_name && that_present_db_name)) return false; - if (!this.new_part.equals(that.new_part)) + if (!this.db_name.equals(that.db_name)) + return false; + } + + boolean this_present_tbl_name = true && this.isSetTbl_name(); + boolean that_present_tbl_name = true && that.isSetTbl_name(); + if (this_present_tbl_name || that_present_tbl_name) { + if (!(this_present_tbl_name && that_present_tbl_name)) + return false; + if (!this.tbl_name.equals(that.tbl_name)) + return false; + } + + boolean this_present_index_name = true && this.isSetIndex_name(); + boolean that_present_index_name = true && that.isSetIndex_name(); + if (this_present_index_name || that_present_index_name) { + if (!(this_present_index_name && that_present_index_name)) + return false; + if (!this.index_name.equals(that.index_name)) return false; } @@ -12398,10 +25615,23 @@ } switch (field.id) { - case NEW_PART: - if (field.type == TType.STRUCT) { - this.new_part = new Partition(); - this.new_part.read(iprot); + case DB_NAME: + if (field.type == TType.STRING) { + this.db_name = iprot.readString(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case TBL_NAME: + if (field.type == TType.STRING) { + this.tbl_name = iprot.readString(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case INDEX_NAME: + if (field.type == TType.STRING) { + this.index_name = iprot.readString(); } else { TProtocolUtil.skip(iprot, field.type); } @@ -12421,9 +25651,19 @@ validate(); oprot.writeStructBegin(STRUCT_DESC); - if (this.new_part != null) { - oprot.writeFieldBegin(NEW_PART_FIELD_DESC); - this.new_part.write(oprot); + if (this.db_name != null) { + oprot.writeFieldBegin(DB_NAME_FIELD_DESC); + oprot.writeString(this.db_name); + oprot.writeFieldEnd(); + } + if (this.tbl_name != null) { + oprot.writeFieldBegin(TBL_NAME_FIELD_DESC); + oprot.writeString(this.tbl_name); + oprot.writeFieldEnd(); + } + if (this.index_name != null) { + oprot.writeFieldBegin(INDEX_NAME_FIELD_DESC); + oprot.writeString(this.index_name); oprot.writeFieldEnd(); } oprot.writeFieldStop(); @@ -12432,14 +25672,30 @@ @Override public String toString() { - StringBuilder sb = new StringBuilder("add_partition_args("); + StringBuilder sb = new StringBuilder("get_index_by_name_args("); boolean first = true; - sb.append("new_part:"); - if (this.new_part == null) { + sb.append("db_name:"); + if (this.db_name == null) { sb.append("null"); } else { - sb.append(this.new_part); + sb.append(this.db_name); + } + first = false; + if (!first) sb.append(", "); + sb.append("tbl_name:"); + if (this.tbl_name == null) { + sb.append("null"); + } else { + sb.append(this.tbl_name); + } + first = false; + if (!first) sb.append(", "); + sb.append("index_name:"); + if (this.index_name == null) { + sb.append("null"); + } else { + sb.append(this.index_name); } first = false; sb.append(")"); @@ -12453,21 +25709,18 @@ } - public static class add_partition_result implements TBase, java.io.Serializable, Cloneable { - private static final TStruct STRUCT_DESC = new TStruct("add_partition_result"); + public static class get_index_by_name_result implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("get_index_by_name_result"); private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.STRUCT, (short)0); private static final TField O1_FIELD_DESC = new TField("o1", TType.STRUCT, (short)1); private static final TField O2_FIELD_DESC = new TField("o2", TType.STRUCT, (short)2); - private static final TField O3_FIELD_DESC = new TField("o3", TType.STRUCT, (short)3); - private Partition success; + private Index success; public static final int SUCCESS = 0; - private InvalidObjectException o1; + private MetaException o1; public static final int O1 = 1; - private AlreadyExistsException o2; + private NoSuchObjectException o2; public static final int O2 = 2; - private MetaException o3; - public static final int O3 = 3; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { @@ -12475,63 +25728,56 @@ public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ put(SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, - new StructMetaData(TType.STRUCT, Partition.class))); + new StructMetaData(TType.STRUCT, Index.class))); put(O1, new FieldMetaData("o1", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRUCT))); put(O2, new FieldMetaData("o2", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRUCT))); - put(O3, new FieldMetaData("o3", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRUCT))); }}); static { - FieldMetaData.addStructMetaDataMap(add_partition_result.class, metaDataMap); + FieldMetaData.addStructMetaDataMap(get_index_by_name_result.class, metaDataMap); } - public add_partition_result() { + public get_index_by_name_result() { } - public add_partition_result( - Partition success, - InvalidObjectException o1, - AlreadyExistsException o2, - MetaException o3) + public get_index_by_name_result( + Index success, + MetaException o1, + NoSuchObjectException o2) { this(); this.success = success; this.o1 = o1; this.o2 = o2; - this.o3 = o3; } /** * Performs a deep copy on other. */ - public add_partition_result(add_partition_result other) { + public get_index_by_name_result(get_index_by_name_result other) { if (other.isSetSuccess()) { - this.success = new Partition(other.success); + this.success = new Index(other.success); } if (other.isSetO1()) { - this.o1 = new InvalidObjectException(other.o1); + this.o1 = new MetaException(other.o1); } if (other.isSetO2()) { - this.o2 = new AlreadyExistsException(other.o2); - } - if (other.isSetO3()) { - this.o3 = new MetaException(other.o3); + this.o2 = new NoSuchObjectException(other.o2); } } @Override - public add_partition_result clone() { - return new add_partition_result(this); + public get_index_by_name_result clone() { + return new get_index_by_name_result(this); } - public Partition getSuccess() { + public Index getSuccess() { return this.success; } - public void setSuccess(Partition success) { + public void setSuccess(Index success) { this.success = success; } @@ -12544,11 +25790,11 @@ return this.success != null; } - public InvalidObjectException getO1() { + public MetaException getO1() { return this.o1; } - public void setO1(InvalidObjectException o1) { + public void setO1(MetaException o1) { this.o1 = o1; } @@ -12561,11 +25807,11 @@ return this.o1 != null; } - public AlreadyExistsException getO2() { + public NoSuchObjectException getO2() { return this.o2; } - public void setO2(AlreadyExistsException o2) { + public void setO2(NoSuchObjectException o2) { this.o2 = o2; } @@ -12578,30 +25824,13 @@ return this.o2 != null; } - public MetaException getO3() { - return this.o3; - } - - public void setO3(MetaException o3) { - this.o3 = o3; - } - - public void unsetO3() { - this.o3 = null; - } - - // Returns true if field o3 is set (has been asigned a value) and false otherwise - public boolean isSetO3() { - return this.o3 != null; - } - public void setFieldValue(int fieldID, Object value) { switch (fieldID) { case SUCCESS: if (value == null) { unsetSuccess(); } else { - setSuccess((Partition)value); + setSuccess((Index)value); } break; @@ -12609,7 +25838,7 @@ if (value == null) { unsetO1(); } else { - setO1((InvalidObjectException)value); + setO1((MetaException)value); } break; @@ -12617,15 +25846,7 @@ if (value == null) { unsetO2(); } else { - setO2((AlreadyExistsException)value); - } - break; - - case O3: - if (value == null) { - unsetO3(); - } else { - setO3((MetaException)value); + setO2((NoSuchObjectException)value); } break; @@ -12645,9 +25866,6 @@ case O2: return getO2(); - case O3: - return getO3(); - default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -12662,8 +25880,6 @@ return isSetO1(); case O2: return isSetO2(); - case O3: - return isSetO3(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -12673,12 +25889,12 @@ public boolean equals(Object that) { if (that == null) return false; - if (that instanceof add_partition_result) - return this.equals((add_partition_result)that); + if (that instanceof get_index_by_name_result) + return this.equals((get_index_by_name_result)that); return false; } - public boolean equals(add_partition_result that) { + public boolean equals(get_index_by_name_result that) { if (that == null) return false; @@ -12709,15 +25925,6 @@ return false; } - boolean this_present_o3 = true && this.isSetO3(); - boolean that_present_o3 = true && that.isSetO3(); - if (this_present_o3 || that_present_o3) { - if (!(this_present_o3 && that_present_o3)) - return false; - if (!this.o3.equals(that.o3)) - return false; - } - return true; } @@ -12739,7 +25946,7 @@ { case SUCCESS: if (field.type == TType.STRUCT) { - this.success = new Partition(); + this.success = new Index(); this.success.read(iprot); } else { TProtocolUtil.skip(iprot, field.type); @@ -12747,7 +25954,7 @@ break; case O1: if (field.type == TType.STRUCT) { - this.o1 = new InvalidObjectException(); + this.o1 = new MetaException(); this.o1.read(iprot); } else { TProtocolUtil.skip(iprot, field.type); @@ -12755,20 +25962,12 @@ break; case O2: if (field.type == TType.STRUCT) { - this.o2 = new AlreadyExistsException(); + this.o2 = new NoSuchObjectException(); this.o2.read(iprot); } else { TProtocolUtil.skip(iprot, field.type); } break; - case O3: - if (field.type == TType.STRUCT) { - this.o3 = new MetaException(); - this.o3.read(iprot); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; default: TProtocolUtil.skip(iprot, field.type); break; @@ -12795,10 +25994,6 @@ oprot.writeFieldBegin(O2_FIELD_DESC); this.o2.write(oprot); oprot.writeFieldEnd(); - } else if (this.isSetO3()) { - oprot.writeFieldBegin(O3_FIELD_DESC); - this.o3.write(oprot); - oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); @@ -12806,7 +26001,7 @@ @Override public String toString() { - StringBuilder sb = new StringBuilder("add_partition_result("); + StringBuilder sb = new StringBuilder("get_index_by_name_result("); boolean first = true; sb.append("success:"); @@ -12832,14 +26027,6 @@ sb.append(this.o2); } first = false; - if (!first) sb.append(", "); - sb.append("o3:"); - if (this.o3 == null) { - sb.append("null"); - } else { - sb.append(this.o3); - } - first = false; sb.append(")"); return sb.toString(); } @@ -12851,21 +26038,22 @@ } - public static class append_partition_args implements TBase, java.io.Serializable, Cloneable { - private static final TStruct STRUCT_DESC = new TStruct("append_partition_args"); + public static class get_indexes_args implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("get_indexes_args"); private static final TField DB_NAME_FIELD_DESC = new TField("db_name", TType.STRING, (short)1); private static final TField TBL_NAME_FIELD_DESC = new TField("tbl_name", TType.STRING, (short)2); - private static final TField PART_VALS_FIELD_DESC = new TField("part_vals", TType.LIST, (short)3); + private static final TField MAX_INDEXES_FIELD_DESC = new TField("max_indexes", TType.I16, (short)3); private String db_name; public static final int DB_NAME = 1; private String tbl_name; public static final int TBL_NAME = 2; - private List part_vals; - public static final int PART_VALS = 3; + private short max_indexes; + public static final int MAX_INDEXES = 3; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { + public boolean max_indexes = false; } public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ @@ -12873,51 +26061,48 @@ new FieldValueMetaData(TType.STRING))); put(TBL_NAME, new FieldMetaData("tbl_name", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRING))); - put(PART_VALS, new FieldMetaData("part_vals", TFieldRequirementType.DEFAULT, - new ListMetaData(TType.LIST, - new FieldValueMetaData(TType.STRING)))); + put(MAX_INDEXES, new FieldMetaData("max_indexes", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.I16))); }}); static { - FieldMetaData.addStructMetaDataMap(append_partition_args.class, metaDataMap); + FieldMetaData.addStructMetaDataMap(get_indexes_args.class, metaDataMap); } - public append_partition_args() { + public get_indexes_args() { + this.max_indexes = (short)-1; + } - public append_partition_args( + public get_indexes_args( String db_name, String tbl_name, - List part_vals) + short max_indexes) { this(); this.db_name = db_name; this.tbl_name = tbl_name; - this.part_vals = part_vals; + this.max_indexes = max_indexes; + this.__isset.max_indexes = true; } /** * Performs a deep copy on other. */ - public append_partition_args(append_partition_args other) { + public get_indexes_args(get_indexes_args other) { if (other.isSetDb_name()) { this.db_name = other.db_name; } if (other.isSetTbl_name()) { this.tbl_name = other.tbl_name; } - if (other.isSetPart_vals()) { - List __this__part_vals = new ArrayList(); - for (String other_element : other.part_vals) { - __this__part_vals.add(other_element); - } - this.part_vals = __this__part_vals; - } + __isset.max_indexes = other.__isset.max_indexes; + this.max_indexes = other.max_indexes; } @Override - public append_partition_args clone() { - return new append_partition_args(this); + public get_indexes_args clone() { + return new get_indexes_args(this); } public String getDb_name() { @@ -12954,36 +26139,22 @@ return this.tbl_name != null; } - public int getPart_valsSize() { - return (this.part_vals == null) ? 0 : this.part_vals.size(); - } - - public java.util.Iterator getPart_valsIterator() { - return (this.part_vals == null) ? null : this.part_vals.iterator(); - } - - public void addToPart_vals(String elem) { - if (this.part_vals == null) { - this.part_vals = new ArrayList(); - } - this.part_vals.add(elem); - } - - public List getPart_vals() { - return this.part_vals; + public short getMax_indexes() { + return this.max_indexes; } - public void setPart_vals(List part_vals) { - this.part_vals = part_vals; + public void setMax_indexes(short max_indexes) { + this.max_indexes = max_indexes; + this.__isset.max_indexes = true; } - public void unsetPart_vals() { - this.part_vals = null; + public void unsetMax_indexes() { + this.__isset.max_indexes = false; } - // Returns true if field part_vals is set (has been asigned a value) and false otherwise - public boolean isSetPart_vals() { - return this.part_vals != null; + // Returns true if field max_indexes is set (has been asigned a value) and false otherwise + public boolean isSetMax_indexes() { + return this.__isset.max_indexes; } public void setFieldValue(int fieldID, Object value) { @@ -13004,11 +26175,11 @@ } break; - case PART_VALS: + case MAX_INDEXES: if (value == null) { - unsetPart_vals(); + unsetMax_indexes(); } else { - setPart_vals((List)value); + setMax_indexes((Short)value); } break; @@ -13025,8 +26196,8 @@ case TBL_NAME: return getTbl_name(); - case PART_VALS: - return getPart_vals(); + case MAX_INDEXES: + return new Short(getMax_indexes()); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); @@ -13040,8 +26211,8 @@ return isSetDb_name(); case TBL_NAME: return isSetTbl_name(); - case PART_VALS: - return isSetPart_vals(); + case MAX_INDEXES: + return isSetMax_indexes(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -13051,12 +26222,12 @@ public boolean equals(Object that) { if (that == null) return false; - if (that instanceof append_partition_args) - return this.equals((append_partition_args)that); + if (that instanceof get_indexes_args) + return this.equals((get_indexes_args)that); return false; } - public boolean equals(append_partition_args that) { + public boolean equals(get_indexes_args that) { if (that == null) return false; @@ -13078,12 +26249,12 @@ return false; } - boolean this_present_part_vals = true && this.isSetPart_vals(); - boolean that_present_part_vals = true && that.isSetPart_vals(); - if (this_present_part_vals || that_present_part_vals) { - if (!(this_present_part_vals && that_present_part_vals)) + boolean this_present_max_indexes = true; + boolean that_present_max_indexes = true; + if (this_present_max_indexes || that_present_max_indexes) { + if (!(this_present_max_indexes && that_present_max_indexes)) return false; - if (!this.part_vals.equals(that.part_vals)) + if (this.max_indexes != that.max_indexes) return false; } @@ -13120,19 +26291,10 @@ TProtocolUtil.skip(iprot, field.type); } break; - case PART_VALS: - if (field.type == TType.LIST) { - { - TList _list87 = iprot.readListBegin(); - this.part_vals = new ArrayList(_list87.size); - for (int _i88 = 0; _i88 < _list87.size; ++_i88) - { - String _elem89; - _elem89 = iprot.readString(); - this.part_vals.add(_elem89); - } - iprot.readListEnd(); - } + case MAX_INDEXES: + if (field.type == TType.I16) { + this.max_indexes = iprot.readI16(); + this.__isset.max_indexes = true; } else { TProtocolUtil.skip(iprot, field.type); } @@ -13162,24 +26324,16 @@ oprot.writeString(this.tbl_name); oprot.writeFieldEnd(); } - if (this.part_vals != null) { - oprot.writeFieldBegin(PART_VALS_FIELD_DESC); - { - oprot.writeListBegin(new TList(TType.STRING, this.part_vals.size())); - for (String _iter90 : this.part_vals) { - oprot.writeString(_iter90); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } + oprot.writeFieldBegin(MAX_INDEXES_FIELD_DESC); + oprot.writeI16(this.max_indexes); + oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } @Override public String toString() { - StringBuilder sb = new StringBuilder("append_partition_args("); + StringBuilder sb = new StringBuilder("get_indexes_args("); boolean first = true; sb.append("db_name:"); @@ -13198,12 +26352,8 @@ } first = false; if (!first) sb.append(", "); - sb.append("part_vals:"); - if (this.part_vals == null) { - sb.append("null"); - } else { - sb.append(this.part_vals); - } + sb.append("max_indexes:"); + sb.append(this.max_indexes); first = false; sb.append(")"); return sb.toString(); @@ -13216,21 +26366,18 @@ } - public static class append_partition_result implements TBase, java.io.Serializable, Cloneable { - private static final TStruct STRUCT_DESC = new TStruct("append_partition_result"); - private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.STRUCT, (short)0); + public static class get_indexes_result implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("get_indexes_result"); + private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.LIST, (short)0); private static final TField O1_FIELD_DESC = new TField("o1", TType.STRUCT, (short)1); private static final TField O2_FIELD_DESC = new TField("o2", TType.STRUCT, (short)2); - private static final TField O3_FIELD_DESC = new TField("o3", TType.STRUCT, (short)3); - private Partition success; + private List success; public static final int SUCCESS = 0; - private InvalidObjectException o1; + private NoSuchObjectException o1; public static final int O1 = 1; - private AlreadyExistsException o2; + private MetaException o2; public static final int O2 = 2; - private MetaException o3; - public static final int O3 = 3; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { @@ -13238,63 +26385,76 @@ public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ put(SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, - new StructMetaData(TType.STRUCT, Partition.class))); + new ListMetaData(TType.LIST, + new StructMetaData(TType.STRUCT, Index.class)))); put(O1, new FieldMetaData("o1", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRUCT))); put(O2, new FieldMetaData("o2", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRUCT))); - put(O3, new FieldMetaData("o3", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRUCT))); }}); static { - FieldMetaData.addStructMetaDataMap(append_partition_result.class, metaDataMap); + FieldMetaData.addStructMetaDataMap(get_indexes_result.class, metaDataMap); } - public append_partition_result() { + public get_indexes_result() { } - public append_partition_result( - Partition success, - InvalidObjectException o1, - AlreadyExistsException o2, - MetaException o3) + public get_indexes_result( + List success, + NoSuchObjectException o1, + MetaException o2) { this(); this.success = success; this.o1 = o1; this.o2 = o2; - this.o3 = o3; } /** * Performs a deep copy on other. */ - public append_partition_result(append_partition_result other) { + public get_indexes_result(get_indexes_result other) { if (other.isSetSuccess()) { - this.success = new Partition(other.success); + List __this__success = new ArrayList(); + for (Index other_element : other.success) { + __this__success.add(new Index(other_element)); + } + this.success = __this__success; } if (other.isSetO1()) { - this.o1 = new InvalidObjectException(other.o1); + this.o1 = new NoSuchObjectException(other.o1); } if (other.isSetO2()) { - this.o2 = new AlreadyExistsException(other.o2); - } - if (other.isSetO3()) { - this.o3 = new MetaException(other.o3); + this.o2 = new MetaException(other.o2); } } @Override - public append_partition_result clone() { - return new append_partition_result(this); + public get_indexes_result clone() { + return new get_indexes_result(this); } - public Partition getSuccess() { + public int getSuccessSize() { + return (this.success == null) ? 0 : this.success.size(); + } + + public java.util.Iterator getSuccessIterator() { + return (this.success == null) ? null : this.success.iterator(); + } + + public void addToSuccess(Index elem) { + if (this.success == null) { + this.success = new ArrayList(); + } + this.success.add(elem); + } + + public List getSuccess() { return this.success; } - public void setSuccess(Partition success) { + public void setSuccess(List success) { this.success = success; } @@ -13307,11 +26467,11 @@ return this.success != null; } - public InvalidObjectException getO1() { + public NoSuchObjectException getO1() { return this.o1; } - public void setO1(InvalidObjectException o1) { + public void setO1(NoSuchObjectException o1) { this.o1 = o1; } @@ -13324,11 +26484,11 @@ return this.o1 != null; } - public AlreadyExistsException getO2() { + public MetaException getO2() { return this.o2; } - public void setO2(AlreadyExistsException o2) { + public void setO2(MetaException o2) { this.o2 = o2; } @@ -13341,30 +26501,13 @@ return this.o2 != null; } - public MetaException getO3() { - return this.o3; - } - - public void setO3(MetaException o3) { - this.o3 = o3; - } - - public void unsetO3() { - this.o3 = null; - } - - // Returns true if field o3 is set (has been asigned a value) and false otherwise - public boolean isSetO3() { - return this.o3 != null; - } - public void setFieldValue(int fieldID, Object value) { switch (fieldID) { case SUCCESS: if (value == null) { unsetSuccess(); } else { - setSuccess((Partition)value); + setSuccess((List)value); } break; @@ -13372,7 +26515,7 @@ if (value == null) { unsetO1(); } else { - setO1((InvalidObjectException)value); + setO1((NoSuchObjectException)value); } break; @@ -13380,15 +26523,7 @@ if (value == null) { unsetO2(); } else { - setO2((AlreadyExistsException)value); - } - break; - - case O3: - if (value == null) { - unsetO3(); - } else { - setO3((MetaException)value); + setO2((MetaException)value); } break; @@ -13408,9 +26543,6 @@ case O2: return getO2(); - case O3: - return getO3(); - default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -13425,8 +26557,6 @@ return isSetO1(); case O2: return isSetO2(); - case O3: - return isSetO3(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -13436,12 +26566,12 @@ public boolean equals(Object that) { if (that == null) return false; - if (that instanceof append_partition_result) - return this.equals((append_partition_result)that); + if (that instanceof get_indexes_result) + return this.equals((get_indexes_result)that); return false; } - public boolean equals(append_partition_result that) { + public boolean equals(get_indexes_result that) { if (that == null) return false; @@ -13472,15 +26602,6 @@ return false; } - boolean this_present_o3 = true && this.isSetO3(); - boolean that_present_o3 = true && that.isSetO3(); - if (this_present_o3 || that_present_o3) { - if (!(this_present_o3 && that_present_o3)) - return false; - if (!this.o3.equals(that.o3)) - return false; - } - return true; } @@ -13501,16 +26622,26 @@ switch (field.id) { case SUCCESS: - if (field.type == TType.STRUCT) { - this.success = new Partition(); - this.success.read(iprot); + if (field.type == TType.LIST) { + { + TList _list175 = iprot.readListBegin(); + this.success = new ArrayList(_list175.size); + for (int _i176 = 0; _i176 < _list175.size; ++_i176) + { + Index _elem177; + _elem177 = new Index(); + _elem177.read(iprot); + this.success.add(_elem177); + } + iprot.readListEnd(); + } } else { TProtocolUtil.skip(iprot, field.type); } break; case O1: if (field.type == TType.STRUCT) { - this.o1 = new InvalidObjectException(); + this.o1 = new NoSuchObjectException(); this.o1.read(iprot); } else { TProtocolUtil.skip(iprot, field.type); @@ -13518,20 +26649,12 @@ break; case O2: if (field.type == TType.STRUCT) { - this.o2 = new AlreadyExistsException(); + this.o2 = new MetaException(); this.o2.read(iprot); } else { TProtocolUtil.skip(iprot, field.type); } break; - case O3: - if (field.type == TType.STRUCT) { - this.o3 = new MetaException(); - this.o3.read(iprot); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; default: TProtocolUtil.skip(iprot, field.type); break; @@ -13548,7 +26671,13 @@ if (this.isSetSuccess()) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - this.success.write(oprot); + { + oprot.writeListBegin(new TList(TType.STRUCT, this.success.size())); + for (Index _iter178 : this.success) { + _iter178.write(oprot); + } + oprot.writeListEnd(); + } oprot.writeFieldEnd(); } else if (this.isSetO1()) { oprot.writeFieldBegin(O1_FIELD_DESC); @@ -13558,10 +26687,6 @@ oprot.writeFieldBegin(O2_FIELD_DESC); this.o2.write(oprot); oprot.writeFieldEnd(); - } else if (this.isSetO3()) { - oprot.writeFieldBegin(O3_FIELD_DESC); - this.o3.write(oprot); - oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); @@ -13569,7 +26694,7 @@ @Override public String toString() { - StringBuilder sb = new StringBuilder("append_partition_result("); + StringBuilder sb = new StringBuilder("get_indexes_result("); boolean first = true; sb.append("success:"); @@ -13595,14 +26720,6 @@ sb.append(this.o2); } first = false; - if (!first) sb.append(", "); - sb.append("o3:"); - if (this.o3 == null) { - sb.append("null"); - } else { - sb.append(this.o3); - } - first = false; sb.append(")"); return sb.toString(); } @@ -13614,21 +26731,22 @@ } - public static class append_partition_by_name_args implements TBase, java.io.Serializable, Cloneable { - private static final TStruct STRUCT_DESC = new TStruct("append_partition_by_name_args"); + public static class get_index_names_args implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("get_index_names_args"); private static final TField DB_NAME_FIELD_DESC = new TField("db_name", TType.STRING, (short)1); private static final TField TBL_NAME_FIELD_DESC = new TField("tbl_name", TType.STRING, (short)2); - private static final TField PART_NAME_FIELD_DESC = new TField("part_name", TType.STRING, (short)3); + private static final TField MAX_INDEXES_FIELD_DESC = new TField("max_indexes", TType.I16, (short)3); private String db_name; public static final int DB_NAME = 1; private String tbl_name; public static final int TBL_NAME = 2; - private String part_name; - public static final int PART_NAME = 3; + private short max_indexes; + public static final int MAX_INDEXES = 3; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { + public boolean max_indexes = false; } public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ @@ -13636,46 +26754,48 @@ new FieldValueMetaData(TType.STRING))); put(TBL_NAME, new FieldMetaData("tbl_name", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRING))); - put(PART_NAME, new FieldMetaData("part_name", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRING))); + put(MAX_INDEXES, new FieldMetaData("max_indexes", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.I16))); }}); static { - FieldMetaData.addStructMetaDataMap(append_partition_by_name_args.class, metaDataMap); + FieldMetaData.addStructMetaDataMap(get_index_names_args.class, metaDataMap); } - public append_partition_by_name_args() { + public get_index_names_args() { + this.max_indexes = (short)-1; + } - public append_partition_by_name_args( + public get_index_names_args( String db_name, String tbl_name, - String part_name) + short max_indexes) { this(); this.db_name = db_name; this.tbl_name = tbl_name; - this.part_name = part_name; + this.max_indexes = max_indexes; + this.__isset.max_indexes = true; } /** * Performs a deep copy on other. */ - public append_partition_by_name_args(append_partition_by_name_args other) { + public get_index_names_args(get_index_names_args other) { if (other.isSetDb_name()) { this.db_name = other.db_name; } if (other.isSetTbl_name()) { this.tbl_name = other.tbl_name; } - if (other.isSetPart_name()) { - this.part_name = other.part_name; - } + __isset.max_indexes = other.__isset.max_indexes; + this.max_indexes = other.max_indexes; } @Override - public append_partition_by_name_args clone() { - return new append_partition_by_name_args(this); + public get_index_names_args clone() { + return new get_index_names_args(this); } public String getDb_name() { @@ -13712,21 +26832,22 @@ return this.tbl_name != null; } - public String getPart_name() { - return this.part_name; + public short getMax_indexes() { + return this.max_indexes; } - public void setPart_name(String part_name) { - this.part_name = part_name; + public void setMax_indexes(short max_indexes) { + this.max_indexes = max_indexes; + this.__isset.max_indexes = true; } - public void unsetPart_name() { - this.part_name = null; + public void unsetMax_indexes() { + this.__isset.max_indexes = false; } - // Returns true if field part_name is set (has been asigned a value) and false otherwise - public boolean isSetPart_name() { - return this.part_name != null; + // Returns true if field max_indexes is set (has been asigned a value) and false otherwise + public boolean isSetMax_indexes() { + return this.__isset.max_indexes; } public void setFieldValue(int fieldID, Object value) { @@ -13747,11 +26868,11 @@ } break; - case PART_NAME: + case MAX_INDEXES: if (value == null) { - unsetPart_name(); + unsetMax_indexes(); } else { - setPart_name((String)value); + setMax_indexes((Short)value); } break; @@ -13768,8 +26889,8 @@ case TBL_NAME: return getTbl_name(); - case PART_NAME: - return getPart_name(); + case MAX_INDEXES: + return new Short(getMax_indexes()); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); @@ -13783,8 +26904,8 @@ return isSetDb_name(); case TBL_NAME: return isSetTbl_name(); - case PART_NAME: - return isSetPart_name(); + case MAX_INDEXES: + return isSetMax_indexes(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -13794,12 +26915,12 @@ public boolean equals(Object that) { if (that == null) return false; - if (that instanceof append_partition_by_name_args) - return this.equals((append_partition_by_name_args)that); + if (that instanceof get_index_names_args) + return this.equals((get_index_names_args)that); return false; } - public boolean equals(append_partition_by_name_args that) { + public boolean equals(get_index_names_args that) { if (that == null) return false; @@ -13821,12 +26942,12 @@ return false; } - boolean this_present_part_name = true && this.isSetPart_name(); - boolean that_present_part_name = true && that.isSetPart_name(); - if (this_present_part_name || that_present_part_name) { - if (!(this_present_part_name && that_present_part_name)) + boolean this_present_max_indexes = true; + boolean that_present_max_indexes = true; + if (this_present_max_indexes || that_present_max_indexes) { + if (!(this_present_max_indexes && that_present_max_indexes)) return false; - if (!this.part_name.equals(that.part_name)) + if (this.max_indexes != that.max_indexes) return false; } @@ -13863,9 +26984,10 @@ TProtocolUtil.skip(iprot, field.type); } break; - case PART_NAME: - if (field.type == TType.STRING) { - this.part_name = iprot.readString(); + case MAX_INDEXES: + if (field.type == TType.I16) { + this.max_indexes = iprot.readI16(); + this.__isset.max_indexes = true; } else { TProtocolUtil.skip(iprot, field.type); } @@ -13895,18 +27017,16 @@ oprot.writeString(this.tbl_name); oprot.writeFieldEnd(); } - if (this.part_name != null) { - oprot.writeFieldBegin(PART_NAME_FIELD_DESC); - oprot.writeString(this.part_name); - oprot.writeFieldEnd(); - } + oprot.writeFieldBegin(MAX_INDEXES_FIELD_DESC); + oprot.writeI16(this.max_indexes); + oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } @Override public String toString() { - StringBuilder sb = new StringBuilder("append_partition_by_name_args("); + StringBuilder sb = new StringBuilder("get_index_names_args("); boolean first = true; sb.append("db_name:"); @@ -13925,12 +27045,8 @@ } first = false; if (!first) sb.append(", "); - sb.append("part_name:"); - if (this.part_name == null) { - sb.append("null"); - } else { - sb.append(this.part_name); - } + sb.append("max_indexes:"); + sb.append(this.max_indexes); first = false; sb.append(")"); return sb.toString(); @@ -13943,21 +27059,15 @@ } - public static class append_partition_by_name_result implements TBase, java.io.Serializable, Cloneable { - private static final TStruct STRUCT_DESC = new TStruct("append_partition_by_name_result"); - private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.STRUCT, (short)0); - private static final TField O1_FIELD_DESC = new TField("o1", TType.STRUCT, (short)1); - private static final TField O2_FIELD_DESC = new TField("o2", TType.STRUCT, (short)2); - private static final TField O3_FIELD_DESC = new TField("o3", TType.STRUCT, (short)3); + public static class get_index_names_result implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("get_index_names_result"); + private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.LIST, (short)0); + private static final TField O2_FIELD_DESC = new TField("o2", TType.STRUCT, (short)1); - private Partition success; + private List success; public static final int SUCCESS = 0; - private InvalidObjectException o1; - public static final int O1 = 1; - private AlreadyExistsException o2; - public static final int O2 = 2; - private MetaException o3; - public static final int O3 = 3; + private MetaException o2; + public static final int O2 = 1; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { @@ -13965,63 +27075,69 @@ public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ put(SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, - new StructMetaData(TType.STRUCT, Partition.class))); - put(O1, new FieldMetaData("o1", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRUCT))); + new ListMetaData(TType.LIST, + new FieldValueMetaData(TType.STRING)))); put(O2, new FieldMetaData("o2", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRUCT))); - put(O3, new FieldMetaData("o3", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRUCT))); }}); static { - FieldMetaData.addStructMetaDataMap(append_partition_by_name_result.class, metaDataMap); + FieldMetaData.addStructMetaDataMap(get_index_names_result.class, metaDataMap); } - public append_partition_by_name_result() { + public get_index_names_result() { } - public append_partition_by_name_result( - Partition success, - InvalidObjectException o1, - AlreadyExistsException o2, - MetaException o3) + public get_index_names_result( + List success, + MetaException o2) { this(); this.success = success; - this.o1 = o1; this.o2 = o2; - this.o3 = o3; } /** * Performs a deep copy on other. */ - public append_partition_by_name_result(append_partition_by_name_result other) { + public get_index_names_result(get_index_names_result other) { if (other.isSetSuccess()) { - this.success = new Partition(other.success); - } - if (other.isSetO1()) { - this.o1 = new InvalidObjectException(other.o1); + List __this__success = new ArrayList(); + for (String other_element : other.success) { + __this__success.add(other_element); + } + this.success = __this__success; } if (other.isSetO2()) { - this.o2 = new AlreadyExistsException(other.o2); - } - if (other.isSetO3()) { - this.o3 = new MetaException(other.o3); + this.o2 = new MetaException(other.o2); } } @Override - public append_partition_by_name_result clone() { - return new append_partition_by_name_result(this); + public get_index_names_result clone() { + return new get_index_names_result(this); } - public Partition getSuccess() { + public int getSuccessSize() { + return (this.success == null) ? 0 : this.success.size(); + } + + public java.util.Iterator getSuccessIterator() { + return (this.success == null) ? null : this.success.iterator(); + } + + public void addToSuccess(String elem) { + if (this.success == null) { + this.success = new ArrayList(); + } + this.success.add(elem); + } + + public List getSuccess() { return this.success; } - public void setSuccess(Partition success) { + public void setSuccess(List success) { this.success = success; } @@ -14034,28 +27150,11 @@ return this.success != null; } - public InvalidObjectException getO1() { - return this.o1; - } - - public void setO1(InvalidObjectException o1) { - this.o1 = o1; - } - - public void unsetO1() { - this.o1 = null; - } - - // Returns true if field o1 is set (has been asigned a value) and false otherwise - public boolean isSetO1() { - return this.o1 != null; - } - - public AlreadyExistsException getO2() { + public MetaException getO2() { return this.o2; } - public void setO2(AlreadyExistsException o2) { + public void setO2(MetaException o2) { this.o2 = o2; } @@ -14068,38 +27167,13 @@ return this.o2 != null; } - public MetaException getO3() { - return this.o3; - } - - public void setO3(MetaException o3) { - this.o3 = o3; - } - - public void unsetO3() { - this.o3 = null; - } - - // Returns true if field o3 is set (has been asigned a value) and false otherwise - public boolean isSetO3() { - return this.o3 != null; - } - public void setFieldValue(int fieldID, Object value) { switch (fieldID) { case SUCCESS: if (value == null) { unsetSuccess(); } else { - setSuccess((Partition)value); - } - break; - - case O1: - if (value == null) { - unsetO1(); - } else { - setO1((InvalidObjectException)value); + setSuccess((List)value); } break; @@ -14107,15 +27181,7 @@ if (value == null) { unsetO2(); } else { - setO2((AlreadyExistsException)value); - } - break; - - case O3: - if (value == null) { - unsetO3(); - } else { - setO3((MetaException)value); + setO2((MetaException)value); } break; @@ -14129,15 +27195,9 @@ case SUCCESS: return getSuccess(); - case O1: - return getO1(); - case O2: return getO2(); - case O3: - return getO3(); - default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -14148,12 +27208,8 @@ switch (fieldID) { case SUCCESS: return isSetSuccess(); - case O1: - return isSetO1(); case O2: return isSetO2(); - case O3: - return isSetO3(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -14163,12 +27219,12 @@ public boolean equals(Object that) { if (that == null) return false; - if (that instanceof append_partition_by_name_result) - return this.equals((append_partition_by_name_result)that); + if (that instanceof get_index_names_result) + return this.equals((get_index_names_result)that); return false; } - public boolean equals(append_partition_by_name_result that) { + public boolean equals(get_index_names_result that) { if (that == null) return false; @@ -14177,16 +27233,7 @@ if (this_present_success || that_present_success) { if (!(this_present_success && that_present_success)) return false; - if (!this.success.equals(that.success)) - return false; - } - - boolean this_present_o1 = true && this.isSetO1(); - boolean that_present_o1 = true && that.isSetO1(); - if (this_present_o1 || that_present_o1) { - if (!(this_present_o1 && that_present_o1)) - return false; - if (!this.o1.equals(that.o1)) + if (!this.success.equals(that.success)) return false; } @@ -14199,15 +27246,6 @@ return false; } - boolean this_present_o3 = true && this.isSetO3(); - boolean that_present_o3 = true && that.isSetO3(); - if (this_present_o3 || that_present_o3) { - if (!(this_present_o3 && that_present_o3)) - return false; - if (!this.o3.equals(that.o3)) - return false; - } - return true; } @@ -14228,37 +27266,30 @@ switch (field.id) { case SUCCESS: - if (field.type == TType.STRUCT) { - this.success = new Partition(); - this.success.read(iprot); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - case O1: - if (field.type == TType.STRUCT) { - this.o1 = new InvalidObjectException(); - this.o1.read(iprot); + if (field.type == TType.LIST) { + { + TList _list179 = iprot.readListBegin(); + this.success = new ArrayList(_list179.size); + for (int _i180 = 0; _i180 < _list179.size; ++_i180) + { + String _elem181; + _elem181 = iprot.readString(); + this.success.add(_elem181); + } + iprot.readListEnd(); + } } else { TProtocolUtil.skip(iprot, field.type); } break; case O2: if (field.type == TType.STRUCT) { - this.o2 = new AlreadyExistsException(); + this.o2 = new MetaException(); this.o2.read(iprot); } else { TProtocolUtil.skip(iprot, field.type); } break; - case O3: - if (field.type == TType.STRUCT) { - this.o3 = new MetaException(); - this.o3.read(iprot); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; default: TProtocolUtil.skip(iprot, field.type); break; @@ -14275,20 +27306,18 @@ if (this.isSetSuccess()) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - this.success.write(oprot); - oprot.writeFieldEnd(); - } else if (this.isSetO1()) { - oprot.writeFieldBegin(O1_FIELD_DESC); - this.o1.write(oprot); + { + oprot.writeListBegin(new TList(TType.STRING, this.success.size())); + for (String _iter182 : this.success) { + oprot.writeString(_iter182); + } + oprot.writeListEnd(); + } oprot.writeFieldEnd(); } else if (this.isSetO2()) { oprot.writeFieldBegin(O2_FIELD_DESC); this.o2.write(oprot); oprot.writeFieldEnd(); - } else if (this.isSetO3()) { - oprot.writeFieldBegin(O3_FIELD_DESC); - this.o3.write(oprot); - oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); @@ -14296,7 +27325,7 @@ @Override public String toString() { - StringBuilder sb = new StringBuilder("append_partition_by_name_result("); + StringBuilder sb = new StringBuilder("get_index_names_result("); boolean first = true; sb.append("success:"); @@ -14307,14 +27336,6 @@ } first = false; if (!first) sb.append(", "); - sb.append("o1:"); - if (this.o1 == null) { - sb.append("null"); - } else { - sb.append(this.o1); - } - first = false; - if (!first) sb.append(", "); sb.append("o2:"); if (this.o2 == null) { sb.append("null"); @@ -14322,14 +27343,6 @@ sb.append(this.o2); } first = false; - if (!first) sb.append(", "); - sb.append("o3:"); - if (this.o3 == null) { - sb.append("null"); - } else { - sb.append(this.o3); - } - first = false; sb.append(")"); return sb.toString(); } @@ -14341,201 +27354,129 @@ } - public static class drop_partition_args implements TBase, java.io.Serializable, Cloneable { - private static final TStruct STRUCT_DESC = new TStruct("drop_partition_args"); - private static final TField DB_NAME_FIELD_DESC = new TField("db_name", TType.STRING, (short)1); - private static final TField TBL_NAME_FIELD_DESC = new TField("tbl_name", TType.STRING, (short)2); - private static final TField PART_VALS_FIELD_DESC = new TField("part_vals", TType.LIST, (short)3); - private static final TField DELETE_DATA_FIELD_DESC = new TField("deleteData", TType.BOOL, (short)4); + public static class get_user_privilege_set_args implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("get_user_privilege_set_args"); + private static final TField USER_NAME_FIELD_DESC = new TField("user_name", TType.STRING, (short)1); + private static final TField GROUP_NAMES_FIELD_DESC = new TField("group_names", TType.LIST, (short)2); - private String db_name; - public static final int DB_NAME = 1; - private String tbl_name; - public static final int TBL_NAME = 2; - private List part_vals; - public static final int PART_VALS = 3; - private boolean deleteData; - public static final int DELETEDATA = 4; + private String user_name; + public static final int USER_NAME = 1; + private List group_names; + public static final int GROUP_NAMES = 2; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { - public boolean deleteData = false; } public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ - put(DB_NAME, new FieldMetaData("db_name", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRING))); - put(TBL_NAME, new FieldMetaData("tbl_name", TFieldRequirementType.DEFAULT, + put(USER_NAME, new FieldMetaData("user_name", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRING))); - put(PART_VALS, new FieldMetaData("part_vals", TFieldRequirementType.DEFAULT, + put(GROUP_NAMES, new FieldMetaData("group_names", TFieldRequirementType.DEFAULT, new ListMetaData(TType.LIST, new FieldValueMetaData(TType.STRING)))); - put(DELETEDATA, new FieldMetaData("deleteData", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.BOOL))); }}); static { - FieldMetaData.addStructMetaDataMap(drop_partition_args.class, metaDataMap); + FieldMetaData.addStructMetaDataMap(get_user_privilege_set_args.class, metaDataMap); } - public drop_partition_args() { + public get_user_privilege_set_args() { } - public drop_partition_args( - String db_name, - String tbl_name, - List part_vals, - boolean deleteData) + public get_user_privilege_set_args( + String user_name, + List group_names) { this(); - this.db_name = db_name; - this.tbl_name = tbl_name; - this.part_vals = part_vals; - this.deleteData = deleteData; - this.__isset.deleteData = true; + this.user_name = user_name; + this.group_names = group_names; } /** * Performs a deep copy on other. */ - public drop_partition_args(drop_partition_args other) { - if (other.isSetDb_name()) { - this.db_name = other.db_name; - } - if (other.isSetTbl_name()) { - this.tbl_name = other.tbl_name; + public get_user_privilege_set_args(get_user_privilege_set_args other) { + if (other.isSetUser_name()) { + this.user_name = other.user_name; } - if (other.isSetPart_vals()) { - List __this__part_vals = new ArrayList(); - for (String other_element : other.part_vals) { - __this__part_vals.add(other_element); + if (other.isSetGroup_names()) { + List __this__group_names = new ArrayList(); + for (String other_element : other.group_names) { + __this__group_names.add(other_element); } - this.part_vals = __this__part_vals; + this.group_names = __this__group_names; } - __isset.deleteData = other.__isset.deleteData; - this.deleteData = other.deleteData; } @Override - public drop_partition_args clone() { - return new drop_partition_args(this); - } - - public String getDb_name() { - return this.db_name; - } - - public void setDb_name(String db_name) { - this.db_name = db_name; - } - - public void unsetDb_name() { - this.db_name = null; - } - - // Returns true if field db_name is set (has been asigned a value) and false otherwise - public boolean isSetDb_name() { - return this.db_name != null; + public get_user_privilege_set_args clone() { + return new get_user_privilege_set_args(this); } - public String getTbl_name() { - return this.tbl_name; + public String getUser_name() { + return this.user_name; } - public void setTbl_name(String tbl_name) { - this.tbl_name = tbl_name; + public void setUser_name(String user_name) { + this.user_name = user_name; } - public void unsetTbl_name() { - this.tbl_name = null; + public void unsetUser_name() { + this.user_name = null; } - // Returns true if field tbl_name is set (has been asigned a value) and false otherwise - public boolean isSetTbl_name() { - return this.tbl_name != null; + // Returns true if field user_name is set (has been asigned a value) and false otherwise + public boolean isSetUser_name() { + return this.user_name != null; } - public int getPart_valsSize() { - return (this.part_vals == null) ? 0 : this.part_vals.size(); + public int getGroup_namesSize() { + return (this.group_names == null) ? 0 : this.group_names.size(); } - public java.util.Iterator getPart_valsIterator() { - return (this.part_vals == null) ? null : this.part_vals.iterator(); + public java.util.Iterator getGroup_namesIterator() { + return (this.group_names == null) ? null : this.group_names.iterator(); } - public void addToPart_vals(String elem) { - if (this.part_vals == null) { - this.part_vals = new ArrayList(); + public void addToGroup_names(String elem) { + if (this.group_names == null) { + this.group_names = new ArrayList(); } - this.part_vals.add(elem); - } - - public List getPart_vals() { - return this.part_vals; - } - - public void setPart_vals(List part_vals) { - this.part_vals = part_vals; - } - - public void unsetPart_vals() { - this.part_vals = null; - } - - // Returns true if field part_vals is set (has been asigned a value) and false otherwise - public boolean isSetPart_vals() { - return this.part_vals != null; - } - - public boolean isDeleteData() { - return this.deleteData; + this.group_names.add(elem); } - public void setDeleteData(boolean deleteData) { - this.deleteData = deleteData; - this.__isset.deleteData = true; + public List getGroup_names() { + return this.group_names; } - public void unsetDeleteData() { - this.__isset.deleteData = false; + public void setGroup_names(List group_names) { + this.group_names = group_names; } - // Returns true if field deleteData is set (has been asigned a value) and false otherwise - public boolean isSetDeleteData() { - return this.__isset.deleteData; + public void unsetGroup_names() { + this.group_names = null; } - public void setFieldValue(int fieldID, Object value) { - switch (fieldID) { - case DB_NAME: - if (value == null) { - unsetDb_name(); - } else { - setDb_name((String)value); - } - break; - - case TBL_NAME: - if (value == null) { - unsetTbl_name(); - } else { - setTbl_name((String)value); - } - break; + // Returns true if field group_names is set (has been asigned a value) and false otherwise + public boolean isSetGroup_names() { + return this.group_names != null; + } - case PART_VALS: + public void setFieldValue(int fieldID, Object value) { + switch (fieldID) { + case USER_NAME: if (value == null) { - unsetPart_vals(); + unsetUser_name(); } else { - setPart_vals((List)value); + setUser_name((String)value); } break; - case DELETEDATA: + case GROUP_NAMES: if (value == null) { - unsetDeleteData(); + unsetGroup_names(); } else { - setDeleteData((Boolean)value); + setGroup_names((List)value); } break; @@ -14546,17 +27487,11 @@ public Object getFieldValue(int fieldID) { switch (fieldID) { - case DB_NAME: - return getDb_name(); - - case TBL_NAME: - return getTbl_name(); - - case PART_VALS: - return getPart_vals(); + case USER_NAME: + return getUser_name(); - case DELETEDATA: - return new Boolean(isDeleteData()); + case GROUP_NAMES: + return getGroup_names(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); @@ -14566,14 +27501,10 @@ // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise public boolean isSet(int fieldID) { switch (fieldID) { - case DB_NAME: - return isSetDb_name(); - case TBL_NAME: - return isSetTbl_name(); - case PART_VALS: - return isSetPart_vals(); - case DELETEDATA: - return isSetDeleteData(); + case USER_NAME: + return isSetUser_name(); + case GROUP_NAMES: + return isSetGroup_names(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -14583,48 +27514,30 @@ public boolean equals(Object that) { if (that == null) return false; - if (that instanceof drop_partition_args) - return this.equals((drop_partition_args)that); + if (that instanceof get_user_privilege_set_args) + return this.equals((get_user_privilege_set_args)that); return false; } - public boolean equals(drop_partition_args that) { + public boolean equals(get_user_privilege_set_args that) { if (that == null) 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) { - if (!(this_present_db_name && that_present_db_name)) - return false; - if (!this.db_name.equals(that.db_name)) - return false; - } - - boolean this_present_tbl_name = true && this.isSetTbl_name(); - boolean that_present_tbl_name = true && that.isSetTbl_name(); - if (this_present_tbl_name || that_present_tbl_name) { - if (!(this_present_tbl_name && that_present_tbl_name)) - return false; - if (!this.tbl_name.equals(that.tbl_name)) - return false; - } - - boolean this_present_part_vals = true && this.isSetPart_vals(); - boolean that_present_part_vals = true && that.isSetPart_vals(); - if (this_present_part_vals || that_present_part_vals) { - if (!(this_present_part_vals && that_present_part_vals)) + boolean this_present_user_name = true && this.isSetUser_name(); + boolean that_present_user_name = true && that.isSetUser_name(); + if (this_present_user_name || that_present_user_name) { + if (!(this_present_user_name && that_present_user_name)) return false; - if (!this.part_vals.equals(that.part_vals)) + if (!this.user_name.equals(that.user_name)) return false; } - boolean this_present_deleteData = true; - boolean that_present_deleteData = true; - if (this_present_deleteData || that_present_deleteData) { - if (!(this_present_deleteData && that_present_deleteData)) + boolean this_present_group_names = true && this.isSetGroup_names(); + boolean that_present_group_names = true && that.isSetGroup_names(); + if (this_present_group_names || that_present_group_names) { + if (!(this_present_group_names && that_present_group_names)) return false; - if (this.deleteData != that.deleteData) + if (!this.group_names.equals(that.group_names)) return false; } @@ -14647,30 +27560,23 @@ } switch (field.id) { - case DB_NAME: - if (field.type == TType.STRING) { - this.db_name = iprot.readString(); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - case TBL_NAME: + case USER_NAME: if (field.type == TType.STRING) { - this.tbl_name = iprot.readString(); + this.user_name = iprot.readString(); } else { TProtocolUtil.skip(iprot, field.type); } break; - case PART_VALS: + case GROUP_NAMES: if (field.type == TType.LIST) { { - TList _list91 = iprot.readListBegin(); - this.part_vals = new ArrayList(_list91.size); - for (int _i92 = 0; _i92 < _list91.size; ++_i92) + TList _list183 = iprot.readListBegin(); + this.group_names = new ArrayList(_list183.size); + for (int _i184 = 0; _i184 < _list183.size; ++_i184) { - String _elem93; - _elem93 = iprot.readString(); - this.part_vals.add(_elem93); + String _elem185; + _elem185 = iprot.readString(); + this.group_names.add(_elem185); } iprot.readListEnd(); } @@ -14678,14 +27584,6 @@ TProtocolUtil.skip(iprot, field.type); } break; - case DELETEDATA: - if (field.type == TType.BOOL) { - this.deleteData = iprot.readBool(); - this.__isset.deleteData = true; - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; default: TProtocolUtil.skip(iprot, field.type); break; @@ -14701,66 +27599,46 @@ validate(); oprot.writeStructBegin(STRUCT_DESC); - if (this.db_name != null) { - oprot.writeFieldBegin(DB_NAME_FIELD_DESC); - oprot.writeString(this.db_name); - oprot.writeFieldEnd(); - } - if (this.tbl_name != null) { - oprot.writeFieldBegin(TBL_NAME_FIELD_DESC); - oprot.writeString(this.tbl_name); + if (this.user_name != null) { + oprot.writeFieldBegin(USER_NAME_FIELD_DESC); + oprot.writeString(this.user_name); oprot.writeFieldEnd(); } - if (this.part_vals != null) { - oprot.writeFieldBegin(PART_VALS_FIELD_DESC); + if (this.group_names != null) { + oprot.writeFieldBegin(GROUP_NAMES_FIELD_DESC); { - oprot.writeListBegin(new TList(TType.STRING, this.part_vals.size())); - for (String _iter94 : this.part_vals) { - oprot.writeString(_iter94); + oprot.writeListBegin(new TList(TType.STRING, this.group_names.size())); + for (String _iter186 : this.group_names) { + oprot.writeString(_iter186); } oprot.writeListEnd(); } oprot.writeFieldEnd(); } - oprot.writeFieldBegin(DELETE_DATA_FIELD_DESC); - oprot.writeBool(this.deleteData); - oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } @Override public String toString() { - StringBuilder sb = new StringBuilder("drop_partition_args("); + StringBuilder sb = new StringBuilder("get_user_privilege_set_args("); boolean first = true; - sb.append("db_name:"); - if (this.db_name == null) { - sb.append("null"); - } else { - sb.append(this.db_name); - } - first = false; - if (!first) sb.append(", "); - sb.append("tbl_name:"); - if (this.tbl_name == null) { + sb.append("user_name:"); + if (this.user_name == null) { sb.append("null"); } else { - sb.append(this.tbl_name); + sb.append(this.user_name); } first = false; if (!first) sb.append(", "); - sb.append("part_vals:"); - if (this.part_vals == null) { + sb.append("group_names:"); + if (this.group_names == null) { sb.append("null"); } else { - sb.append(this.part_vals); + sb.append(this.group_names); } first = false; - if (!first) sb.append(", "); - sb.append("deleteData:"); - sb.append(this.deleteData); - first = false; sb.append(")"); return sb.toString(); } @@ -14772,94 +27650,82 @@ } - public static class drop_partition_result implements TBase, java.io.Serializable, Cloneable { - private static final TStruct STRUCT_DESC = new TStruct("drop_partition_result"); - private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.BOOL, (short)0); + public static class get_user_privilege_set_result implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("get_user_privilege_set_result"); + private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.STRUCT, (short)0); private static final TField O1_FIELD_DESC = new TField("o1", TType.STRUCT, (short)1); - private static final TField O2_FIELD_DESC = new TField("o2", TType.STRUCT, (short)2); - private boolean success; + private PrincipalPrivilegeSet success; public static final int SUCCESS = 0; - private NoSuchObjectException o1; + private MetaException o1; public static final int O1 = 1; - private MetaException o2; - public static final int O2 = 2; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { - public boolean success = false; } public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ put(SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.BOOL))); + new StructMetaData(TType.STRUCT, PrincipalPrivilegeSet.class))); put(O1, new FieldMetaData("o1", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRUCT))); - put(O2, new FieldMetaData("o2", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRUCT))); }}); static { - FieldMetaData.addStructMetaDataMap(drop_partition_result.class, metaDataMap); + FieldMetaData.addStructMetaDataMap(get_user_privilege_set_result.class, metaDataMap); } - public drop_partition_result() { + public get_user_privilege_set_result() { } - public drop_partition_result( - boolean success, - NoSuchObjectException o1, - MetaException o2) + public get_user_privilege_set_result( + PrincipalPrivilegeSet success, + MetaException o1) { this(); this.success = success; - this.__isset.success = true; this.o1 = o1; - this.o2 = o2; } /** * Performs a deep copy on other. */ - public drop_partition_result(drop_partition_result other) { - __isset.success = other.__isset.success; - this.success = other.success; - if (other.isSetO1()) { - this.o1 = new NoSuchObjectException(other.o1); + public get_user_privilege_set_result(get_user_privilege_set_result other) { + if (other.isSetSuccess()) { + this.success = new PrincipalPrivilegeSet(other.success); } - if (other.isSetO2()) { - this.o2 = new MetaException(other.o2); + if (other.isSetO1()) { + this.o1 = new MetaException(other.o1); } } @Override - public drop_partition_result clone() { - return new drop_partition_result(this); + public get_user_privilege_set_result clone() { + return new get_user_privilege_set_result(this); } - public boolean isSuccess() { + public PrincipalPrivilegeSet getSuccess() { return this.success; } - public void setSuccess(boolean success) { + public void setSuccess(PrincipalPrivilegeSet success) { this.success = success; - this.__isset.success = true; } public void unsetSuccess() { - this.__isset.success = false; + this.success = null; } // Returns true if field success is set (has been asigned a value) and false otherwise public boolean isSetSuccess() { - return this.__isset.success; + return this.success != null; } - public NoSuchObjectException getO1() { + public MetaException getO1() { return this.o1; } - public void setO1(NoSuchObjectException o1) { + public void setO1(MetaException o1) { this.o1 = o1; } @@ -14872,46 +27738,21 @@ return this.o1 != null; } - public MetaException getO2() { - return this.o2; - } - - public void setO2(MetaException o2) { - this.o2 = o2; - } - - public void unsetO2() { - this.o2 = null; - } - - // Returns true if field o2 is set (has been asigned a value) and false otherwise - public boolean isSetO2() { - return this.o2 != null; - } - public void setFieldValue(int fieldID, Object value) { switch (fieldID) { case SUCCESS: if (value == null) { unsetSuccess(); } else { - setSuccess((Boolean)value); - } - break; - - case O1: - if (value == null) { - unsetO1(); - } else { - setO1((NoSuchObjectException)value); + setSuccess((PrincipalPrivilegeSet)value); } break; - case O2: + case O1: if (value == null) { - unsetO2(); + unsetO1(); } else { - setO2((MetaException)value); + setO1((MetaException)value); } break; @@ -14923,14 +27764,11 @@ public Object getFieldValue(int fieldID) { switch (fieldID) { case SUCCESS: - return new Boolean(isSuccess()); + return getSuccess(); case O1: return getO1(); - case O2: - return getO2(); - default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -14943,8 +27781,6 @@ return isSetSuccess(); case O1: return isSetO1(); - case O2: - return isSetO2(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -14954,21 +27790,21 @@ public boolean equals(Object that) { if (that == null) return false; - if (that instanceof drop_partition_result) - return this.equals((drop_partition_result)that); + if (that instanceof get_user_privilege_set_result) + return this.equals((get_user_privilege_set_result)that); return false; } - public boolean equals(drop_partition_result that) { + public boolean equals(get_user_privilege_set_result that) { if (that == null) return false; - boolean this_present_success = true; - boolean that_present_success = true; + boolean this_present_success = true && this.isSetSuccess(); + boolean that_present_success = true && that.isSetSuccess(); if (this_present_success || that_present_success) { if (!(this_present_success && that_present_success)) return false; - if (this.success != that.success) + if (!this.success.equals(that.success)) return false; } @@ -14981,15 +27817,6 @@ return false; } - boolean this_present_o2 = true && this.isSetO2(); - boolean that_present_o2 = true && that.isSetO2(); - if (this_present_o2 || that_present_o2) { - if (!(this_present_o2 && that_present_o2)) - return false; - if (!this.o2.equals(that.o2)) - return false; - } - return true; } @@ -15010,29 +27837,21 @@ switch (field.id) { case SUCCESS: - if (field.type == TType.BOOL) { - this.success = iprot.readBool(); - this.__isset.success = true; + if (field.type == TType.STRUCT) { + this.success = new PrincipalPrivilegeSet(); + this.success.read(iprot); } else { TProtocolUtil.skip(iprot, field.type); } break; case O1: if (field.type == TType.STRUCT) { - this.o1 = new NoSuchObjectException(); + this.o1 = new MetaException(); this.o1.read(iprot); } else { TProtocolUtil.skip(iprot, field.type); } break; - case O2: - if (field.type == TType.STRUCT) { - this.o2 = new MetaException(); - this.o2.read(iprot); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; default: TProtocolUtil.skip(iprot, field.type); break; @@ -15049,16 +27868,12 @@ if (this.isSetSuccess()) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - oprot.writeBool(this.success); + this.success.write(oprot); oprot.writeFieldEnd(); } else if (this.isSetO1()) { oprot.writeFieldBegin(O1_FIELD_DESC); this.o1.write(oprot); oprot.writeFieldEnd(); - } else if (this.isSetO2()) { - oprot.writeFieldBegin(O2_FIELD_DESC); - this.o2.write(oprot); - oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); @@ -15066,26 +27881,22 @@ @Override public String toString() { - StringBuilder sb = new StringBuilder("drop_partition_result("); + StringBuilder sb = new StringBuilder("get_user_privilege_set_result("); boolean first = true; sb.append("success:"); - sb.append(this.success); - first = false; - if (!first) sb.append(", "); - sb.append("o1:"); - if (this.o1 == null) { + if (this.success == null) { sb.append("null"); } else { - sb.append(this.o1); + sb.append(this.success); } first = false; if (!first) sb.append(", "); - sb.append("o2:"); - if (this.o2 == null) { + sb.append("o1:"); + if (this.o1 == null) { sb.append("null"); } else { - sb.append(this.o2); + sb.append(this.o1); } first = false; sb.append(")"); @@ -15099,79 +27910,73 @@ } - public static class drop_partition_by_name_args implements TBase, java.io.Serializable, Cloneable { - private static final TStruct STRUCT_DESC = new TStruct("drop_partition_by_name_args"); + public static class get_db_privilege_set_args implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("get_db_privilege_set_args"); private static final TField DB_NAME_FIELD_DESC = new TField("db_name", TType.STRING, (short)1); - private static final TField TBL_NAME_FIELD_DESC = new TField("tbl_name", TType.STRING, (short)2); - private static final TField PART_NAME_FIELD_DESC = new TField("part_name", TType.STRING, (short)3); - private static final TField DELETE_DATA_FIELD_DESC = new TField("deleteData", TType.BOOL, (short)4); + private static final TField USER_NAME_FIELD_DESC = new TField("user_name", TType.STRING, (short)2); + private static final TField GROUP_NAMES_FIELD_DESC = new TField("group_names", TType.LIST, (short)3); private String db_name; public static final int DB_NAME = 1; - private String tbl_name; - public static final int TBL_NAME = 2; - private String part_name; - public static final int PART_NAME = 3; - private boolean deleteData; - public static final int DELETEDATA = 4; + private String user_name; + public static final int USER_NAME = 2; + private List group_names; + public static final int GROUP_NAMES = 3; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { - public boolean deleteData = false; } public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ put(DB_NAME, new FieldMetaData("db_name", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRING))); - put(TBL_NAME, new FieldMetaData("tbl_name", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRING))); - put(PART_NAME, new FieldMetaData("part_name", TFieldRequirementType.DEFAULT, + put(USER_NAME, new FieldMetaData("user_name", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRING))); - put(DELETEDATA, new FieldMetaData("deleteData", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.BOOL))); + put(GROUP_NAMES, new FieldMetaData("group_names", TFieldRequirementType.DEFAULT, + new ListMetaData(TType.LIST, + new FieldValueMetaData(TType.STRING)))); }}); static { - FieldMetaData.addStructMetaDataMap(drop_partition_by_name_args.class, metaDataMap); + FieldMetaData.addStructMetaDataMap(get_db_privilege_set_args.class, metaDataMap); } - public drop_partition_by_name_args() { + public get_db_privilege_set_args() { } - public drop_partition_by_name_args( + public get_db_privilege_set_args( String db_name, - String tbl_name, - String part_name, - boolean deleteData) + String user_name, + List group_names) { this(); this.db_name = db_name; - this.tbl_name = tbl_name; - this.part_name = part_name; - this.deleteData = deleteData; - this.__isset.deleteData = true; + this.user_name = user_name; + this.group_names = group_names; } /** * Performs a deep copy on other. */ - public drop_partition_by_name_args(drop_partition_by_name_args other) { + public get_db_privilege_set_args(get_db_privilege_set_args other) { if (other.isSetDb_name()) { this.db_name = other.db_name; } - if (other.isSetTbl_name()) { - this.tbl_name = other.tbl_name; + if (other.isSetUser_name()) { + this.user_name = other.user_name; } - if (other.isSetPart_name()) { - this.part_name = other.part_name; + if (other.isSetGroup_names()) { + List __this__group_names = new ArrayList(); + for (String other_element : other.group_names) { + __this__group_names.add(other_element); + } + this.group_names = __this__group_names; } - __isset.deleteData = other.__isset.deleteData; - this.deleteData = other.deleteData; } @Override - public drop_partition_by_name_args clone() { - return new drop_partition_by_name_args(this); + public get_db_privilege_set_args clone() { + return new get_db_privilege_set_args(this); } public String getDb_name() { @@ -15191,56 +27996,53 @@ return this.db_name != null; } - public String getTbl_name() { - return this.tbl_name; - } - - public void setTbl_name(String tbl_name) { - this.tbl_name = tbl_name; + public String getUser_name() { + return this.user_name; } - public void unsetTbl_name() { - this.tbl_name = null; + public void setUser_name(String user_name) { + this.user_name = user_name; } - // Returns true if field tbl_name is set (has been asigned a value) and false otherwise - public boolean isSetTbl_name() { - return this.tbl_name != null; + public void unsetUser_name() { + this.user_name = null; } - public String getPart_name() { - return this.part_name; + // Returns true if field user_name is set (has been asigned a value) and false otherwise + public boolean isSetUser_name() { + return this.user_name != null; } - public void setPart_name(String part_name) { - this.part_name = part_name; + public int getGroup_namesSize() { + return (this.group_names == null) ? 0 : this.group_names.size(); } - public void unsetPart_name() { - this.part_name = null; + public java.util.Iterator getGroup_namesIterator() { + return (this.group_names == null) ? null : this.group_names.iterator(); } - // Returns true if field part_name is set (has been asigned a value) and false otherwise - public boolean isSetPart_name() { - return this.part_name != null; + public void addToGroup_names(String elem) { + if (this.group_names == null) { + this.group_names = new ArrayList(); + } + this.group_names.add(elem); } - public boolean isDeleteData() { - return this.deleteData; + public List getGroup_names() { + return this.group_names; } - public void setDeleteData(boolean deleteData) { - this.deleteData = deleteData; - this.__isset.deleteData = true; + public void setGroup_names(List group_names) { + this.group_names = group_names; } - public void unsetDeleteData() { - this.__isset.deleteData = false; + public void unsetGroup_names() { + this.group_names = null; } - // Returns true if field deleteData is set (has been asigned a value) and false otherwise - public boolean isSetDeleteData() { - return this.__isset.deleteData; + // Returns true if field group_names is set (has been asigned a value) and false otherwise + public boolean isSetGroup_names() { + return this.group_names != null; } public void setFieldValue(int fieldID, Object value) { @@ -15253,27 +28055,19 @@ } break; - case TBL_NAME: - if (value == null) { - unsetTbl_name(); - } else { - setTbl_name((String)value); - } - break; - - case PART_NAME: + case USER_NAME: if (value == null) { - unsetPart_name(); + unsetUser_name(); } else { - setPart_name((String)value); + setUser_name((String)value); } break; - case DELETEDATA: + case GROUP_NAMES: if (value == null) { - unsetDeleteData(); + unsetGroup_names(); } else { - setDeleteData((Boolean)value); + setGroup_names((List)value); } break; @@ -15287,14 +28081,11 @@ case DB_NAME: return getDb_name(); - case TBL_NAME: - return getTbl_name(); - - case PART_NAME: - return getPart_name(); + case USER_NAME: + return getUser_name(); - case DELETEDATA: - return new Boolean(isDeleteData()); + case GROUP_NAMES: + return getGroup_names(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); @@ -15306,12 +28097,10 @@ switch (fieldID) { case DB_NAME: return isSetDb_name(); - case TBL_NAME: - return isSetTbl_name(); - case PART_NAME: - return isSetPart_name(); - case DELETEDATA: - return isSetDeleteData(); + case USER_NAME: + return isSetUser_name(); + case GROUP_NAMES: + return isSetGroup_names(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -15321,12 +28110,12 @@ public boolean equals(Object that) { if (that == null) return false; - if (that instanceof drop_partition_by_name_args) - return this.equals((drop_partition_by_name_args)that); + if (that instanceof get_db_privilege_set_args) + return this.equals((get_db_privilege_set_args)that); return false; } - public boolean equals(drop_partition_by_name_args that) { + public boolean equals(get_db_privilege_set_args that) { if (that == null) return false; @@ -15339,30 +28128,21 @@ return false; } - boolean this_present_tbl_name = true && this.isSetTbl_name(); - boolean that_present_tbl_name = true && that.isSetTbl_name(); - if (this_present_tbl_name || that_present_tbl_name) { - if (!(this_present_tbl_name && that_present_tbl_name)) - return false; - if (!this.tbl_name.equals(that.tbl_name)) - return false; - } - - boolean this_present_part_name = true && this.isSetPart_name(); - boolean that_present_part_name = true && that.isSetPart_name(); - if (this_present_part_name || that_present_part_name) { - if (!(this_present_part_name && that_present_part_name)) + boolean this_present_user_name = true && this.isSetUser_name(); + boolean that_present_user_name = true && that.isSetUser_name(); + if (this_present_user_name || that_present_user_name) { + if (!(this_present_user_name && that_present_user_name)) return false; - if (!this.part_name.equals(that.part_name)) + if (!this.user_name.equals(that.user_name)) return false; } - boolean this_present_deleteData = true; - boolean that_present_deleteData = true; - if (this_present_deleteData || that_present_deleteData) { - if (!(this_present_deleteData && that_present_deleteData)) + boolean this_present_group_names = true && this.isSetGroup_names(); + boolean that_present_group_names = true && that.isSetGroup_names(); + if (this_present_group_names || that_present_group_names) { + if (!(this_present_group_names && that_present_group_names)) return false; - if (this.deleteData != that.deleteData) + if (!this.group_names.equals(that.group_names)) return false; } @@ -15392,24 +28172,26 @@ TProtocolUtil.skip(iprot, field.type); } break; - case TBL_NAME: - if (field.type == TType.STRING) { - this.tbl_name = iprot.readString(); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - case PART_NAME: + case USER_NAME: if (field.type == TType.STRING) { - this.part_name = iprot.readString(); + this.user_name = iprot.readString(); } else { TProtocolUtil.skip(iprot, field.type); } break; - case DELETEDATA: - if (field.type == TType.BOOL) { - this.deleteData = iprot.readBool(); - this.__isset.deleteData = true; + case GROUP_NAMES: + if (field.type == TType.LIST) { + { + TList _list187 = iprot.readListBegin(); + this.group_names = new ArrayList(_list187.size); + for (int _i188 = 0; _i188 < _list187.size; ++_i188) + { + String _elem189; + _elem189 = iprot.readString(); + this.group_names.add(_elem189); + } + iprot.readListEnd(); + } } else { TProtocolUtil.skip(iprot, field.type); } @@ -15434,26 +28216,29 @@ oprot.writeString(this.db_name); oprot.writeFieldEnd(); } - if (this.tbl_name != null) { - oprot.writeFieldBegin(TBL_NAME_FIELD_DESC); - oprot.writeString(this.tbl_name); + if (this.user_name != null) { + oprot.writeFieldBegin(USER_NAME_FIELD_DESC); + oprot.writeString(this.user_name); oprot.writeFieldEnd(); } - if (this.part_name != null) { - oprot.writeFieldBegin(PART_NAME_FIELD_DESC); - oprot.writeString(this.part_name); + if (this.group_names != null) { + oprot.writeFieldBegin(GROUP_NAMES_FIELD_DESC); + { + oprot.writeListBegin(new TList(TType.STRING, this.group_names.size())); + for (String _iter190 : this.group_names) { + oprot.writeString(_iter190); + } + oprot.writeListEnd(); + } oprot.writeFieldEnd(); } - oprot.writeFieldBegin(DELETE_DATA_FIELD_DESC); - oprot.writeBool(this.deleteData); - oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } @Override public String toString() { - StringBuilder sb = new StringBuilder("drop_partition_by_name_args("); + StringBuilder sb = new StringBuilder("get_db_privilege_set_args("); boolean first = true; sb.append("db_name:"); @@ -15464,25 +28249,21 @@ } first = false; if (!first) sb.append(", "); - sb.append("tbl_name:"); - if (this.tbl_name == null) { + sb.append("user_name:"); + if (this.user_name == null) { sb.append("null"); } else { - sb.append(this.tbl_name); + sb.append(this.user_name); } first = false; if (!first) sb.append(", "); - sb.append("part_name:"); - if (this.part_name == null) { + sb.append("group_names:"); + if (this.group_names == null) { sb.append("null"); } else { - sb.append(this.part_name); + sb.append(this.group_names); } first = false; - if (!first) sb.append(", "); - sb.append("deleteData:"); - sb.append(this.deleteData); - first = false; sb.append(")"); return sb.toString(); } @@ -15494,94 +28275,82 @@ } - public static class drop_partition_by_name_result implements TBase, java.io.Serializable, Cloneable { - private static final TStruct STRUCT_DESC = new TStruct("drop_partition_by_name_result"); - private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.BOOL, (short)0); + public static class get_db_privilege_set_result implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("get_db_privilege_set_result"); + private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.STRUCT, (short)0); private static final TField O1_FIELD_DESC = new TField("o1", TType.STRUCT, (short)1); - private static final TField O2_FIELD_DESC = new TField("o2", TType.STRUCT, (short)2); - private boolean success; + private PrincipalPrivilegeSet success; public static final int SUCCESS = 0; - private NoSuchObjectException o1; + private MetaException o1; public static final int O1 = 1; - private MetaException o2; - public static final int O2 = 2; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { - public boolean success = false; } public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ put(SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.BOOL))); + new StructMetaData(TType.STRUCT, PrincipalPrivilegeSet.class))); put(O1, new FieldMetaData("o1", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRUCT))); - put(O2, new FieldMetaData("o2", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRUCT))); }}); static { - FieldMetaData.addStructMetaDataMap(drop_partition_by_name_result.class, metaDataMap); + FieldMetaData.addStructMetaDataMap(get_db_privilege_set_result.class, metaDataMap); } - public drop_partition_by_name_result() { + public get_db_privilege_set_result() { } - public drop_partition_by_name_result( - boolean success, - NoSuchObjectException o1, - MetaException o2) + public get_db_privilege_set_result( + PrincipalPrivilegeSet success, + MetaException o1) { this(); this.success = success; - this.__isset.success = true; this.o1 = o1; - this.o2 = o2; } /** * Performs a deep copy on other. */ - public drop_partition_by_name_result(drop_partition_by_name_result other) { - __isset.success = other.__isset.success; - this.success = other.success; - if (other.isSetO1()) { - this.o1 = new NoSuchObjectException(other.o1); + public get_db_privilege_set_result(get_db_privilege_set_result other) { + if (other.isSetSuccess()) { + this.success = new PrincipalPrivilegeSet(other.success); } - if (other.isSetO2()) { - this.o2 = new MetaException(other.o2); + if (other.isSetO1()) { + this.o1 = new MetaException(other.o1); } } @Override - public drop_partition_by_name_result clone() { - return new drop_partition_by_name_result(this); + public get_db_privilege_set_result clone() { + return new get_db_privilege_set_result(this); } - public boolean isSuccess() { + public PrincipalPrivilegeSet getSuccess() { return this.success; } - public void setSuccess(boolean success) { + public void setSuccess(PrincipalPrivilegeSet success) { this.success = success; - this.__isset.success = true; } public void unsetSuccess() { - this.__isset.success = false; + this.success = null; } // Returns true if field success is set (has been asigned a value) and false otherwise public boolean isSetSuccess() { - return this.__isset.success; + return this.success != null; } - public NoSuchObjectException getO1() { + public MetaException getO1() { return this.o1; } - public void setO1(NoSuchObjectException o1) { + public void setO1(MetaException o1) { this.o1 = o1; } @@ -15594,30 +28363,13 @@ return this.o1 != null; } - public MetaException getO2() { - return this.o2; - } - - public void setO2(MetaException o2) { - this.o2 = o2; - } - - public void unsetO2() { - this.o2 = null; - } - - // Returns true if field o2 is set (has been asigned a value) and false otherwise - public boolean isSetO2() { - return this.o2 != null; - } - public void setFieldValue(int fieldID, Object value) { switch (fieldID) { case SUCCESS: if (value == null) { unsetSuccess(); } else { - setSuccess((Boolean)value); + setSuccess((PrincipalPrivilegeSet)value); } break; @@ -15625,15 +28377,7 @@ if (value == null) { unsetO1(); } else { - setO1((NoSuchObjectException)value); - } - break; - - case O2: - if (value == null) { - unsetO2(); - } else { - setO2((MetaException)value); + setO1((MetaException)value); } break; @@ -15645,14 +28389,11 @@ public Object getFieldValue(int fieldID) { switch (fieldID) { case SUCCESS: - return new Boolean(isSuccess()); + return getSuccess(); case O1: return getO1(); - case O2: - return getO2(); - default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -15665,8 +28406,6 @@ return isSetSuccess(); case O1: return isSetO1(); - case O2: - return isSetO2(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -15676,21 +28415,21 @@ public boolean equals(Object that) { if (that == null) return false; - if (that instanceof drop_partition_by_name_result) - return this.equals((drop_partition_by_name_result)that); + if (that instanceof get_db_privilege_set_result) + return this.equals((get_db_privilege_set_result)that); return false; } - public boolean equals(drop_partition_by_name_result that) { + public boolean equals(get_db_privilege_set_result that) { if (that == null) return false; - boolean this_present_success = true; - boolean that_present_success = true; + boolean this_present_success = true && this.isSetSuccess(); + boolean that_present_success = true && that.isSetSuccess(); if (this_present_success || that_present_success) { if (!(this_present_success && that_present_success)) return false; - if (this.success != that.success) + if (!this.success.equals(that.success)) return false; } @@ -15703,15 +28442,6 @@ return false; } - boolean this_present_o2 = true && this.isSetO2(); - boolean that_present_o2 = true && that.isSetO2(); - if (this_present_o2 || that_present_o2) { - if (!(this_present_o2 && that_present_o2)) - return false; - if (!this.o2.equals(that.o2)) - return false; - } - return true; } @@ -15732,29 +28462,21 @@ switch (field.id) { case SUCCESS: - if (field.type == TType.BOOL) { - this.success = iprot.readBool(); - this.__isset.success = true; + if (field.type == TType.STRUCT) { + this.success = new PrincipalPrivilegeSet(); + this.success.read(iprot); } else { TProtocolUtil.skip(iprot, field.type); } break; case O1: if (field.type == TType.STRUCT) { - this.o1 = new NoSuchObjectException(); + this.o1 = new MetaException(); this.o1.read(iprot); } else { TProtocolUtil.skip(iprot, field.type); } break; - case O2: - if (field.type == TType.STRUCT) { - this.o2 = new MetaException(); - this.o2.read(iprot); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; default: TProtocolUtil.skip(iprot, field.type); break; @@ -15771,16 +28493,12 @@ if (this.isSetSuccess()) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - oprot.writeBool(this.success); + this.success.write(oprot); oprot.writeFieldEnd(); } else if (this.isSetO1()) { oprot.writeFieldBegin(O1_FIELD_DESC); this.o1.write(oprot); oprot.writeFieldEnd(); - } else if (this.isSetO2()) { - oprot.writeFieldBegin(O2_FIELD_DESC); - this.o2.write(oprot); - oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); @@ -15788,26 +28506,22 @@ @Override public String toString() { - StringBuilder sb = new StringBuilder("drop_partition_by_name_result("); + StringBuilder sb = new StringBuilder("get_db_privilege_set_result("); boolean first = true; sb.append("success:"); - sb.append(this.success); - first = false; - if (!first) sb.append(", "); - sb.append("o1:"); - if (this.o1 == null) { + if (this.success == null) { sb.append("null"); } else { - sb.append(this.o1); + sb.append(this.success); } first = false; if (!first) sb.append(", "); - sb.append("o2:"); - if (this.o2 == null) { + sb.append("o1:"); + if (this.o1 == null) { sb.append("null"); } else { - sb.append(this.o2); + sb.append(this.o1); } first = false; sb.append(")"); @@ -15821,18 +28535,21 @@ } - public static class get_partition_args implements TBase, java.io.Serializable, Cloneable { - private static final TStruct STRUCT_DESC = new TStruct("get_partition_args"); + public static class get_table_privilege_set_args implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("get_table_privilege_set_args"); private static final TField DB_NAME_FIELD_DESC = new TField("db_name", TType.STRING, (short)1); - private static final TField TBL_NAME_FIELD_DESC = new TField("tbl_name", TType.STRING, (short)2); - private static final TField PART_VALS_FIELD_DESC = new TField("part_vals", TType.LIST, (short)3); + private static final TField TABLE_NAME_FIELD_DESC = new TField("table_name", TType.STRING, (short)2); + private static final TField USER_NAME_FIELD_DESC = new TField("user_name", TType.STRING, (short)3); + private static final TField GROUP_NAMES_FIELD_DESC = new TField("group_names", TType.LIST, (short)4); private String db_name; public static final int DB_NAME = 1; - private String tbl_name; - public static final int TBL_NAME = 2; - private List part_vals; - public static final int PART_VALS = 3; + private String table_name; + public static final int TABLE_NAME = 2; + private String user_name; + public static final int USER_NAME = 3; + private List group_names; + public static final int GROUP_NAMES = 4; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { @@ -15841,53 +28558,60 @@ public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ put(DB_NAME, new FieldMetaData("db_name", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRING))); - put(TBL_NAME, new FieldMetaData("tbl_name", TFieldRequirementType.DEFAULT, + put(TABLE_NAME, new FieldMetaData("table_name", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRING))); - put(PART_VALS, new FieldMetaData("part_vals", TFieldRequirementType.DEFAULT, + put(USER_NAME, new FieldMetaData("user_name", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + put(GROUP_NAMES, new FieldMetaData("group_names", TFieldRequirementType.DEFAULT, new ListMetaData(TType.LIST, new FieldValueMetaData(TType.STRING)))); }}); static { - FieldMetaData.addStructMetaDataMap(get_partition_args.class, metaDataMap); + FieldMetaData.addStructMetaDataMap(get_table_privilege_set_args.class, metaDataMap); } - public get_partition_args() { + public get_table_privilege_set_args() { } - public get_partition_args( + public get_table_privilege_set_args( String db_name, - String tbl_name, - List part_vals) + String table_name, + String user_name, + List group_names) { this(); this.db_name = db_name; - this.tbl_name = tbl_name; - this.part_vals = part_vals; + this.table_name = table_name; + this.user_name = user_name; + this.group_names = group_names; } /** * Performs a deep copy on other. */ - public get_partition_args(get_partition_args other) { + public get_table_privilege_set_args(get_table_privilege_set_args other) { if (other.isSetDb_name()) { this.db_name = other.db_name; } - if (other.isSetTbl_name()) { - this.tbl_name = other.tbl_name; + if (other.isSetTable_name()) { + this.table_name = other.table_name; } - if (other.isSetPart_vals()) { - List __this__part_vals = new ArrayList(); - for (String other_element : other.part_vals) { - __this__part_vals.add(other_element); + if (other.isSetUser_name()) { + this.user_name = other.user_name; + } + if (other.isSetGroup_names()) { + List __this__group_names = new ArrayList(); + for (String other_element : other.group_names) { + __this__group_names.add(other_element); } - this.part_vals = __this__part_vals; + this.group_names = __this__group_names; } } @Override - public get_partition_args clone() { - return new get_partition_args(this); + public get_table_privilege_set_args clone() { + return new get_table_privilege_set_args(this); } public String getDb_name() { @@ -15907,53 +28631,70 @@ return this.db_name != null; } - public String getTbl_name() { - return this.tbl_name; + public String getTable_name() { + return this.table_name; } - public void setTbl_name(String tbl_name) { - this.tbl_name = tbl_name; + public void setTable_name(String table_name) { + this.table_name = table_name; } - public void unsetTbl_name() { - this.tbl_name = null; + public void unsetTable_name() { + this.table_name = null; } - // Returns true if field tbl_name is set (has been asigned a value) and false otherwise - public boolean isSetTbl_name() { - return this.tbl_name != null; + // Returns true if field table_name is set (has been asigned a value) and false otherwise + public boolean isSetTable_name() { + return this.table_name != null; } - public int getPart_valsSize() { - return (this.part_vals == null) ? 0 : this.part_vals.size(); + public String getUser_name() { + return this.user_name; } - public java.util.Iterator getPart_valsIterator() { - return (this.part_vals == null) ? null : this.part_vals.iterator(); + public void setUser_name(String user_name) { + this.user_name = user_name; } - public void addToPart_vals(String elem) { - if (this.part_vals == null) { - this.part_vals = new ArrayList(); + public void unsetUser_name() { + this.user_name = null; + } + + // Returns true if field user_name is set (has been asigned a value) and false otherwise + public boolean isSetUser_name() { + return this.user_name != null; + } + + public int getGroup_namesSize() { + return (this.group_names == null) ? 0 : this.group_names.size(); + } + + public java.util.Iterator getGroup_namesIterator() { + return (this.group_names == null) ? null : this.group_names.iterator(); + } + + public void addToGroup_names(String elem) { + if (this.group_names == null) { + this.group_names = new ArrayList(); } - this.part_vals.add(elem); + this.group_names.add(elem); } - public List getPart_vals() { - return this.part_vals; + public List getGroup_names() { + return this.group_names; } - public void setPart_vals(List part_vals) { - this.part_vals = part_vals; + public void setGroup_names(List group_names) { + this.group_names = group_names; } - public void unsetPart_vals() { - this.part_vals = null; + public void unsetGroup_names() { + this.group_names = null; } - // Returns true if field part_vals is set (has been asigned a value) and false otherwise - public boolean isSetPart_vals() { - return this.part_vals != null; + // Returns true if field group_names is set (has been asigned a value) and false otherwise + public boolean isSetGroup_names() { + return this.group_names != null; } public void setFieldValue(int fieldID, Object value) { @@ -15966,19 +28707,27 @@ } break; - case TBL_NAME: + case TABLE_NAME: if (value == null) { - unsetTbl_name(); + unsetTable_name(); } else { - setTbl_name((String)value); + setTable_name((String)value); } break; - case PART_VALS: + case USER_NAME: if (value == null) { - unsetPart_vals(); + unsetUser_name(); } else { - setPart_vals((List)value); + setUser_name((String)value); + } + break; + + case GROUP_NAMES: + if (value == null) { + unsetGroup_names(); + } else { + setGroup_names((List)value); } break; @@ -15992,11 +28741,14 @@ case DB_NAME: return getDb_name(); - case TBL_NAME: - return getTbl_name(); + case TABLE_NAME: + return getTable_name(); - case PART_VALS: - return getPart_vals(); + case USER_NAME: + return getUser_name(); + + case GROUP_NAMES: + return getGroup_names(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); @@ -16008,10 +28760,12 @@ switch (fieldID) { case DB_NAME: return isSetDb_name(); - case TBL_NAME: - return isSetTbl_name(); - case PART_VALS: - return isSetPart_vals(); + case TABLE_NAME: + return isSetTable_name(); + case USER_NAME: + return isSetUser_name(); + case GROUP_NAMES: + return isSetGroup_names(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -16021,12 +28775,12 @@ public boolean equals(Object that) { if (that == null) return false; - if (that instanceof get_partition_args) - return this.equals((get_partition_args)that); + if (that instanceof get_table_privilege_set_args) + return this.equals((get_table_privilege_set_args)that); return false; } - public boolean equals(get_partition_args that) { + public boolean equals(get_table_privilege_set_args that) { if (that == null) return false; @@ -16039,21 +28793,30 @@ return false; } - boolean this_present_tbl_name = true && this.isSetTbl_name(); - boolean that_present_tbl_name = true && that.isSetTbl_name(); - if (this_present_tbl_name || that_present_tbl_name) { - if (!(this_present_tbl_name && that_present_tbl_name)) + boolean this_present_table_name = true && this.isSetTable_name(); + boolean that_present_table_name = true && that.isSetTable_name(); + if (this_present_table_name || that_present_table_name) { + if (!(this_present_table_name && that_present_table_name)) return false; - if (!this.tbl_name.equals(that.tbl_name)) + if (!this.table_name.equals(that.table_name)) return false; } - boolean this_present_part_vals = true && this.isSetPart_vals(); - boolean that_present_part_vals = true && that.isSetPart_vals(); - if (this_present_part_vals || that_present_part_vals) { - if (!(this_present_part_vals && that_present_part_vals)) + boolean this_present_user_name = true && this.isSetUser_name(); + boolean that_present_user_name = true && that.isSetUser_name(); + if (this_present_user_name || that_present_user_name) { + if (!(this_present_user_name && that_present_user_name)) return false; - if (!this.part_vals.equals(that.part_vals)) + if (!this.user_name.equals(that.user_name)) + return false; + } + + boolean this_present_group_names = true && this.isSetGroup_names(); + boolean that_present_group_names = true && that.isSetGroup_names(); + if (this_present_group_names || that_present_group_names) { + if (!(this_present_group_names && that_present_group_names)) + return false; + if (!this.group_names.equals(that.group_names)) return false; } @@ -16083,23 +28846,30 @@ TProtocolUtil.skip(iprot, field.type); } break; - case TBL_NAME: + case TABLE_NAME: if (field.type == TType.STRING) { - this.tbl_name = iprot.readString(); + this.table_name = iprot.readString(); } else { TProtocolUtil.skip(iprot, field.type); } break; - case PART_VALS: + case USER_NAME: + if (field.type == TType.STRING) { + this.user_name = iprot.readString(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case GROUP_NAMES: if (field.type == TType.LIST) { { - TList _list95 = iprot.readListBegin(); - this.part_vals = new ArrayList(_list95.size); - for (int _i96 = 0; _i96 < _list95.size; ++_i96) + TList _list191 = iprot.readListBegin(); + this.group_names = new ArrayList(_list191.size); + for (int _i192 = 0; _i192 < _list191.size; ++_i192) { - String _elem97; - _elem97 = iprot.readString(); - this.part_vals.add(_elem97); + String _elem193; + _elem193 = iprot.readString(); + this.group_names.add(_elem193); } iprot.readListEnd(); } @@ -16127,17 +28897,22 @@ oprot.writeString(this.db_name); oprot.writeFieldEnd(); } - if (this.tbl_name != null) { - oprot.writeFieldBegin(TBL_NAME_FIELD_DESC); - oprot.writeString(this.tbl_name); + if (this.table_name != null) { + oprot.writeFieldBegin(TABLE_NAME_FIELD_DESC); + oprot.writeString(this.table_name); oprot.writeFieldEnd(); } - if (this.part_vals != null) { - oprot.writeFieldBegin(PART_VALS_FIELD_DESC); + if (this.user_name != null) { + oprot.writeFieldBegin(USER_NAME_FIELD_DESC); + oprot.writeString(this.user_name); + oprot.writeFieldEnd(); + } + if (this.group_names != null) { + oprot.writeFieldBegin(GROUP_NAMES_FIELD_DESC); { - oprot.writeListBegin(new TList(TType.STRING, this.part_vals.size())); - for (String _iter98 : this.part_vals) { - oprot.writeString(_iter98); + oprot.writeListBegin(new TList(TType.STRING, this.group_names.size())); + for (String _iter194 : this.group_names) { + oprot.writeString(_iter194); } oprot.writeListEnd(); } @@ -16149,7 +28924,7 @@ @Override public String toString() { - StringBuilder sb = new StringBuilder("get_partition_args("); + StringBuilder sb = new StringBuilder("get_table_privilege_set_args("); boolean first = true; sb.append("db_name:"); @@ -16160,19 +28935,27 @@ } first = false; if (!first) sb.append(", "); - sb.append("tbl_name:"); - if (this.tbl_name == null) { + sb.append("table_name:"); + if (this.table_name == null) { sb.append("null"); } else { - sb.append(this.tbl_name); + sb.append(this.table_name); } first = false; if (!first) sb.append(", "); - sb.append("part_vals:"); - if (this.part_vals == null) { + sb.append("user_name:"); + if (this.user_name == null) { + sb.append("null"); + } else { + sb.append(this.user_name); + } + first = false; + if (!first) sb.append(", "); + sb.append("group_names:"); + if (this.group_names == null) { sb.append("null"); } else { - sb.append(this.part_vals); + sb.append(this.group_names); } first = false; sb.append(")"); @@ -16186,18 +28969,15 @@ } - public static class get_partition_result implements TBase, java.io.Serializable, Cloneable { - private static final TStruct STRUCT_DESC = new TStruct("get_partition_result"); + public static class get_table_privilege_set_result implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("get_table_privilege_set_result"); private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.STRUCT, (short)0); private static final TField O1_FIELD_DESC = new TField("o1", TType.STRUCT, (short)1); - private static final TField O2_FIELD_DESC = new TField("o2", TType.STRUCT, (short)2); - private Partition success; + private PrincipalPrivilegeSet success; public static final int SUCCESS = 0; private MetaException o1; public static final int O1 = 1; - private NoSuchObjectException o2; - public static final int O2 = 2; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { @@ -16205,56 +28985,49 @@ public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ put(SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, - new StructMetaData(TType.STRUCT, Partition.class))); + new StructMetaData(TType.STRUCT, PrincipalPrivilegeSet.class))); put(O1, new FieldMetaData("o1", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRUCT))); - put(O2, new FieldMetaData("o2", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRUCT))); }}); static { - FieldMetaData.addStructMetaDataMap(get_partition_result.class, metaDataMap); + FieldMetaData.addStructMetaDataMap(get_table_privilege_set_result.class, metaDataMap); } - public get_partition_result() { + public get_table_privilege_set_result() { } - public get_partition_result( - Partition success, - MetaException o1, - NoSuchObjectException o2) + public get_table_privilege_set_result( + PrincipalPrivilegeSet success, + MetaException o1) { this(); this.success = success; this.o1 = o1; - this.o2 = o2; } /** * Performs a deep copy on other. */ - public get_partition_result(get_partition_result other) { + public get_table_privilege_set_result(get_table_privilege_set_result other) { if (other.isSetSuccess()) { - this.success = new Partition(other.success); + this.success = new PrincipalPrivilegeSet(other.success); } if (other.isSetO1()) { this.o1 = new MetaException(other.o1); } - if (other.isSetO2()) { - this.o2 = new NoSuchObjectException(other.o2); - } } @Override - public get_partition_result clone() { - return new get_partition_result(this); + public get_table_privilege_set_result clone() { + return new get_table_privilege_set_result(this); } - public Partition getSuccess() { + public PrincipalPrivilegeSet getSuccess() { return this.success; } - public void setSuccess(Partition success) { + public void setSuccess(PrincipalPrivilegeSet success) { this.success = success; } @@ -16284,30 +29057,13 @@ return this.o1 != null; } - public NoSuchObjectException getO2() { - return this.o2; - } - - public void setO2(NoSuchObjectException o2) { - this.o2 = o2; - } - - public void unsetO2() { - this.o2 = null; - } - - // Returns true if field o2 is set (has been asigned a value) and false otherwise - public boolean isSetO2() { - return this.o2 != null; - } - public void setFieldValue(int fieldID, Object value) { switch (fieldID) { case SUCCESS: if (value == null) { unsetSuccess(); } else { - setSuccess((Partition)value); + setSuccess((PrincipalPrivilegeSet)value); } break; @@ -16319,14 +29075,6 @@ } break; - case O2: - if (value == null) { - unsetO2(); - } else { - setO2((NoSuchObjectException)value); - } - break; - default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -16340,9 +29088,6 @@ case O1: return getO1(); - case O2: - return getO2(); - default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -16355,8 +29100,6 @@ return isSetSuccess(); case O1: return isSetO1(); - case O2: - return isSetO2(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -16366,12 +29109,12 @@ public boolean equals(Object that) { if (that == null) return false; - if (that instanceof get_partition_result) - return this.equals((get_partition_result)that); + if (that instanceof get_table_privilege_set_result) + return this.equals((get_table_privilege_set_result)that); return false; } - public boolean equals(get_partition_result that) { + public boolean equals(get_table_privilege_set_result that) { if (that == null) return false; @@ -16393,15 +29136,6 @@ return false; } - boolean this_present_o2 = true && this.isSetO2(); - boolean that_present_o2 = true && that.isSetO2(); - if (this_present_o2 || that_present_o2) { - if (!(this_present_o2 && that_present_o2)) - return false; - if (!this.o2.equals(that.o2)) - return false; - } - return true; } @@ -16423,7 +29157,7 @@ { case SUCCESS: if (field.type == TType.STRUCT) { - this.success = new Partition(); + this.success = new PrincipalPrivilegeSet(); this.success.read(iprot); } else { TProtocolUtil.skip(iprot, field.type); @@ -16437,14 +29171,6 @@ TProtocolUtil.skip(iprot, field.type); } break; - case O2: - if (field.type == TType.STRUCT) { - this.o2 = new NoSuchObjectException(); - this.o2.read(iprot); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; default: TProtocolUtil.skip(iprot, field.type); break; @@ -16467,10 +29193,6 @@ oprot.writeFieldBegin(O1_FIELD_DESC); this.o1.write(oprot); oprot.writeFieldEnd(); - } else if (this.isSetO2()) { - oprot.writeFieldBegin(O2_FIELD_DESC); - this.o2.write(oprot); - oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); @@ -16478,7 +29200,7 @@ @Override public String toString() { - StringBuilder sb = new StringBuilder("get_partition_result("); + StringBuilder sb = new StringBuilder("get_table_privilege_set_result("); boolean first = true; sb.append("success:"); @@ -16496,14 +29218,6 @@ sb.append(this.o1); } first = false; - if (!first) sb.append(", "); - sb.append("o2:"); - if (this.o2 == null) { - sb.append("null"); - } else { - sb.append(this.o2); - } - first = false; sb.append(")"); return sb.toString(); } @@ -16515,18 +29229,24 @@ } - public static class get_partition_by_name_args implements TBase, java.io.Serializable, Cloneable { - private static final TStruct STRUCT_DESC = new TStruct("get_partition_by_name_args"); + public static class get_partition_privilege_set_args implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("get_partition_privilege_set_args"); private static final TField DB_NAME_FIELD_DESC = new TField("db_name", TType.STRING, (short)1); - private static final TField TBL_NAME_FIELD_DESC = new TField("tbl_name", TType.STRING, (short)2); + private static final TField TABLE_NAME_FIELD_DESC = new TField("table_name", TType.STRING, (short)2); private static final TField PART_NAME_FIELD_DESC = new TField("part_name", TType.STRING, (short)3); + private static final TField USER_NAME_FIELD_DESC = new TField("user_name", TType.STRING, (short)4); + private static final TField GROUP_NAMES_FIELD_DESC = new TField("group_names", TType.LIST, (short)5); private String db_name; public static final int DB_NAME = 1; - private String tbl_name; - public static final int TBL_NAME = 2; + private String table_name; + public static final int TABLE_NAME = 2; private String part_name; public static final int PART_NAME = 3; + private String user_name; + public static final int USER_NAME = 4; + private List group_names; + public static final int GROUP_NAMES = 5; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { @@ -16535,48 +29255,67 @@ public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ put(DB_NAME, new FieldMetaData("db_name", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRING))); - put(TBL_NAME, new FieldMetaData("tbl_name", TFieldRequirementType.DEFAULT, + put(TABLE_NAME, new FieldMetaData("table_name", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRING))); put(PART_NAME, new FieldMetaData("part_name", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRING))); + put(USER_NAME, new FieldMetaData("user_name", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + put(GROUP_NAMES, new FieldMetaData("group_names", TFieldRequirementType.DEFAULT, + new ListMetaData(TType.LIST, + new FieldValueMetaData(TType.STRING)))); }}); static { - FieldMetaData.addStructMetaDataMap(get_partition_by_name_args.class, metaDataMap); + FieldMetaData.addStructMetaDataMap(get_partition_privilege_set_args.class, metaDataMap); } - public get_partition_by_name_args() { + public get_partition_privilege_set_args() { } - public get_partition_by_name_args( + public get_partition_privilege_set_args( String db_name, - String tbl_name, - String part_name) + String table_name, + String part_name, + String user_name, + List group_names) { this(); this.db_name = db_name; - this.tbl_name = tbl_name; + this.table_name = table_name; this.part_name = part_name; + this.user_name = user_name; + this.group_names = group_names; } /** * Performs a deep copy on other. */ - public get_partition_by_name_args(get_partition_by_name_args other) { + public get_partition_privilege_set_args(get_partition_privilege_set_args other) { if (other.isSetDb_name()) { this.db_name = other.db_name; } - if (other.isSetTbl_name()) { - this.tbl_name = other.tbl_name; + if (other.isSetTable_name()) { + this.table_name = other.table_name; } if (other.isSetPart_name()) { this.part_name = other.part_name; } + if (other.isSetUser_name()) { + this.user_name = other.user_name; + } + if (other.isSetGroup_names()) { + List __this__group_names = new ArrayList(); + for (String other_element : other.group_names) { + __this__group_names.add(other_element); + } + this.group_names = __this__group_names; + } } @Override - public get_partition_by_name_args clone() { - return new get_partition_by_name_args(this); + public get_partition_privilege_set_args clone() { + return new get_partition_privilege_set_args(this); } public String getDb_name() { @@ -16596,21 +29335,21 @@ return this.db_name != null; } - public String getTbl_name() { - return this.tbl_name; + public String getTable_name() { + return this.table_name; } - public void setTbl_name(String tbl_name) { - this.tbl_name = tbl_name; + public void setTable_name(String table_name) { + this.table_name = table_name; } - public void unsetTbl_name() { - this.tbl_name = null; + public void unsetTable_name() { + this.table_name = null; } - // Returns true if field tbl_name is set (has been asigned a value) and false otherwise - public boolean isSetTbl_name() { - return this.tbl_name != null; + // Returns true if field table_name is set (has been asigned a value) and false otherwise + public boolean isSetTable_name() { + return this.table_name != null; } public String getPart_name() { @@ -16630,29 +29369,94 @@ return this.part_name != null; } + public String getUser_name() { + return this.user_name; + } + + public void setUser_name(String user_name) { + this.user_name = user_name; + } + + public void unsetUser_name() { + this.user_name = null; + } + + // Returns true if field user_name is set (has been asigned a value) and false otherwise + public boolean isSetUser_name() { + return this.user_name != null; + } + + public int getGroup_namesSize() { + return (this.group_names == null) ? 0 : this.group_names.size(); + } + + public java.util.Iterator getGroup_namesIterator() { + return (this.group_names == null) ? null : this.group_names.iterator(); + } + + public void addToGroup_names(String elem) { + if (this.group_names == null) { + this.group_names = new ArrayList(); + } + this.group_names.add(elem); + } + + public List getGroup_names() { + return this.group_names; + } + + public void setGroup_names(List group_names) { + this.group_names = group_names; + } + + public void unsetGroup_names() { + this.group_names = null; + } + + // Returns true if field group_names is set (has been asigned a value) and false otherwise + public boolean isSetGroup_names() { + return this.group_names != null; + } + public void setFieldValue(int fieldID, Object value) { switch (fieldID) { case DB_NAME: if (value == null) { - unsetDb_name(); + unsetDb_name(); + } else { + setDb_name((String)value); + } + break; + + case TABLE_NAME: + if (value == null) { + unsetTable_name(); + } else { + setTable_name((String)value); + } + break; + + case PART_NAME: + if (value == null) { + unsetPart_name(); } else { - setDb_name((String)value); + setPart_name((String)value); } break; - case TBL_NAME: + case USER_NAME: if (value == null) { - unsetTbl_name(); + unsetUser_name(); } else { - setTbl_name((String)value); + setUser_name((String)value); } break; - case PART_NAME: + case GROUP_NAMES: if (value == null) { - unsetPart_name(); + unsetGroup_names(); } else { - setPart_name((String)value); + setGroup_names((List)value); } break; @@ -16666,12 +29470,18 @@ case DB_NAME: return getDb_name(); - case TBL_NAME: - return getTbl_name(); + case TABLE_NAME: + return getTable_name(); case PART_NAME: return getPart_name(); + case USER_NAME: + return getUser_name(); + + case GROUP_NAMES: + return getGroup_names(); + default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -16682,10 +29492,14 @@ switch (fieldID) { case DB_NAME: return isSetDb_name(); - case TBL_NAME: - return isSetTbl_name(); + case TABLE_NAME: + return isSetTable_name(); case PART_NAME: return isSetPart_name(); + case USER_NAME: + return isSetUser_name(); + case GROUP_NAMES: + return isSetGroup_names(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -16695,12 +29509,12 @@ public boolean equals(Object that) { if (that == null) return false; - if (that instanceof get_partition_by_name_args) - return this.equals((get_partition_by_name_args)that); + if (that instanceof get_partition_privilege_set_args) + return this.equals((get_partition_privilege_set_args)that); return false; } - public boolean equals(get_partition_by_name_args that) { + public boolean equals(get_partition_privilege_set_args that) { if (that == null) return false; @@ -16713,12 +29527,12 @@ return false; } - boolean this_present_tbl_name = true && this.isSetTbl_name(); - boolean that_present_tbl_name = true && that.isSetTbl_name(); - if (this_present_tbl_name || that_present_tbl_name) { - if (!(this_present_tbl_name && that_present_tbl_name)) + boolean this_present_table_name = true && this.isSetTable_name(); + boolean that_present_table_name = true && that.isSetTable_name(); + if (this_present_table_name || that_present_table_name) { + if (!(this_present_table_name && that_present_table_name)) return false; - if (!this.tbl_name.equals(that.tbl_name)) + if (!this.table_name.equals(that.table_name)) return false; } @@ -16731,6 +29545,24 @@ return false; } + boolean this_present_user_name = true && this.isSetUser_name(); + boolean that_present_user_name = true && that.isSetUser_name(); + if (this_present_user_name || that_present_user_name) { + if (!(this_present_user_name && that_present_user_name)) + return false; + if (!this.user_name.equals(that.user_name)) + return false; + } + + boolean this_present_group_names = true && this.isSetGroup_names(); + boolean that_present_group_names = true && that.isSetGroup_names(); + if (this_present_group_names || that_present_group_names) { + if (!(this_present_group_names && that_present_group_names)) + return false; + if (!this.group_names.equals(that.group_names)) + return false; + } + return true; } @@ -16757,9 +29589,9 @@ TProtocolUtil.skip(iprot, field.type); } break; - case TBL_NAME: + case TABLE_NAME: if (field.type == TType.STRING) { - this.tbl_name = iprot.readString(); + this.table_name = iprot.readString(); } else { TProtocolUtil.skip(iprot, field.type); } @@ -16771,6 +29603,30 @@ TProtocolUtil.skip(iprot, field.type); } break; + case USER_NAME: + if (field.type == TType.STRING) { + this.user_name = iprot.readString(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case GROUP_NAMES: + if (field.type == TType.LIST) { + { + TList _list195 = iprot.readListBegin(); + this.group_names = new ArrayList(_list195.size); + for (int _i196 = 0; _i196 < _list195.size; ++_i196) + { + String _elem197; + _elem197 = iprot.readString(); + this.group_names.add(_elem197); + } + iprot.readListEnd(); + } + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; default: TProtocolUtil.skip(iprot, field.type); break; @@ -16791,9 +29647,9 @@ oprot.writeString(this.db_name); oprot.writeFieldEnd(); } - if (this.tbl_name != null) { - oprot.writeFieldBegin(TBL_NAME_FIELD_DESC); - oprot.writeString(this.tbl_name); + if (this.table_name != null) { + oprot.writeFieldBegin(TABLE_NAME_FIELD_DESC); + oprot.writeString(this.table_name); oprot.writeFieldEnd(); } if (this.part_name != null) { @@ -16801,13 +29657,29 @@ oprot.writeString(this.part_name); oprot.writeFieldEnd(); } + if (this.user_name != null) { + oprot.writeFieldBegin(USER_NAME_FIELD_DESC); + oprot.writeString(this.user_name); + oprot.writeFieldEnd(); + } + if (this.group_names != null) { + oprot.writeFieldBegin(GROUP_NAMES_FIELD_DESC); + { + oprot.writeListBegin(new TList(TType.STRING, this.group_names.size())); + for (String _iter198 : this.group_names) { + oprot.writeString(_iter198); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } oprot.writeFieldStop(); oprot.writeStructEnd(); } @Override public String toString() { - StringBuilder sb = new StringBuilder("get_partition_by_name_args("); + StringBuilder sb = new StringBuilder("get_partition_privilege_set_args("); boolean first = true; sb.append("db_name:"); @@ -16818,11 +29690,11 @@ } first = false; if (!first) sb.append(", "); - sb.append("tbl_name:"); - if (this.tbl_name == null) { + sb.append("table_name:"); + if (this.table_name == null) { sb.append("null"); } else { - sb.append(this.tbl_name); + sb.append(this.table_name); } first = false; if (!first) sb.append(", "); @@ -16833,6 +29705,22 @@ sb.append(this.part_name); } first = false; + if (!first) sb.append(", "); + sb.append("user_name:"); + if (this.user_name == null) { + sb.append("null"); + } else { + sb.append(this.user_name); + } + first = false; + if (!first) sb.append(", "); + sb.append("group_names:"); + if (this.group_names == null) { + sb.append("null"); + } else { + sb.append(this.group_names); + } + first = false; sb.append(")"); return sb.toString(); } @@ -16844,18 +29732,15 @@ } - public static class get_partition_by_name_result implements TBase, java.io.Serializable, Cloneable { - private static final TStruct STRUCT_DESC = new TStruct("get_partition_by_name_result"); + public static class get_partition_privilege_set_result implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("get_partition_privilege_set_result"); private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.STRUCT, (short)0); private static final TField O1_FIELD_DESC = new TField("o1", TType.STRUCT, (short)1); - private static final TField O2_FIELD_DESC = new TField("o2", TType.STRUCT, (short)2); - private Partition success; + private PrincipalPrivilegeSet success; public static final int SUCCESS = 0; private MetaException o1; public static final int O1 = 1; - private NoSuchObjectException o2; - public static final int O2 = 2; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { @@ -16863,56 +29748,49 @@ public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ put(SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, - new StructMetaData(TType.STRUCT, Partition.class))); + new StructMetaData(TType.STRUCT, PrincipalPrivilegeSet.class))); put(O1, new FieldMetaData("o1", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRUCT))); - put(O2, new FieldMetaData("o2", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRUCT))); }}); static { - FieldMetaData.addStructMetaDataMap(get_partition_by_name_result.class, metaDataMap); + FieldMetaData.addStructMetaDataMap(get_partition_privilege_set_result.class, metaDataMap); } - public get_partition_by_name_result() { + public get_partition_privilege_set_result() { } - public get_partition_by_name_result( - Partition success, - MetaException o1, - NoSuchObjectException o2) + public get_partition_privilege_set_result( + PrincipalPrivilegeSet success, + MetaException o1) { this(); this.success = success; this.o1 = o1; - this.o2 = o2; } /** * Performs a deep copy on other. */ - public get_partition_by_name_result(get_partition_by_name_result other) { + public get_partition_privilege_set_result(get_partition_privilege_set_result other) { if (other.isSetSuccess()) { - this.success = new Partition(other.success); + this.success = new PrincipalPrivilegeSet(other.success); } if (other.isSetO1()) { this.o1 = new MetaException(other.o1); } - if (other.isSetO2()) { - this.o2 = new NoSuchObjectException(other.o2); - } } @Override - public get_partition_by_name_result clone() { - return new get_partition_by_name_result(this); + public get_partition_privilege_set_result clone() { + return new get_partition_privilege_set_result(this); } - public Partition getSuccess() { + public PrincipalPrivilegeSet getSuccess() { return this.success; } - public void setSuccess(Partition success) { + public void setSuccess(PrincipalPrivilegeSet success) { this.success = success; } @@ -16942,30 +29820,13 @@ return this.o1 != null; } - public NoSuchObjectException getO2() { - return this.o2; - } - - public void setO2(NoSuchObjectException o2) { - this.o2 = o2; - } - - public void unsetO2() { - this.o2 = null; - } - - // Returns true if field o2 is set (has been asigned a value) and false otherwise - public boolean isSetO2() { - return this.o2 != null; - } - public void setFieldValue(int fieldID, Object value) { switch (fieldID) { case SUCCESS: if (value == null) { unsetSuccess(); } else { - setSuccess((Partition)value); + setSuccess((PrincipalPrivilegeSet)value); } break; @@ -16977,14 +29838,6 @@ } break; - case O2: - if (value == null) { - unsetO2(); - } else { - setO2((NoSuchObjectException)value); - } - break; - default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -16998,9 +29851,6 @@ case O1: return getO1(); - case O2: - return getO2(); - default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -17013,8 +29863,6 @@ return isSetSuccess(); case O1: return isSetO1(); - case O2: - return isSetO2(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -17024,12 +29872,12 @@ public boolean equals(Object that) { if (that == null) return false; - if (that instanceof get_partition_by_name_result) - return this.equals((get_partition_by_name_result)that); + if (that instanceof get_partition_privilege_set_result) + return this.equals((get_partition_privilege_set_result)that); return false; } - public boolean equals(get_partition_by_name_result that) { + public boolean equals(get_partition_privilege_set_result that) { if (that == null) return false; @@ -17051,15 +29899,6 @@ return false; } - boolean this_present_o2 = true && this.isSetO2(); - boolean that_present_o2 = true && that.isSetO2(); - if (this_present_o2 || that_present_o2) { - if (!(this_present_o2 && that_present_o2)) - return false; - if (!this.o2.equals(that.o2)) - return false; - } - return true; } @@ -17081,7 +29920,7 @@ { case SUCCESS: if (field.type == TType.STRUCT) { - this.success = new Partition(); + this.success = new PrincipalPrivilegeSet(); this.success.read(iprot); } else { TProtocolUtil.skip(iprot, field.type); @@ -17095,14 +29934,6 @@ TProtocolUtil.skip(iprot, field.type); } break; - case O2: - if (field.type == TType.STRUCT) { - this.o2 = new NoSuchObjectException(); - this.o2.read(iprot); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; default: TProtocolUtil.skip(iprot, field.type); break; @@ -17125,10 +29956,6 @@ oprot.writeFieldBegin(O1_FIELD_DESC); this.o1.write(oprot); oprot.writeFieldEnd(); - } else if (this.isSetO2()) { - oprot.writeFieldBegin(O2_FIELD_DESC); - this.o2.write(oprot); - oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); @@ -17136,7 +29963,7 @@ @Override public String toString() { - StringBuilder sb = new StringBuilder("get_partition_by_name_result("); + StringBuilder sb = new StringBuilder("get_partition_privilege_set_result("); boolean first = true; sb.append("success:"); @@ -17154,14 +29981,6 @@ sb.append(this.o1); } first = false; - if (!first) sb.append(", "); - sb.append("o2:"); - if (this.o2 == null) { - sb.append("null"); - } else { - sb.append(this.o2); - } - first = false; sb.append(")"); return sb.toString(); } @@ -17173,71 +29992,103 @@ } - public static class get_partitions_args implements TBase, java.io.Serializable, Cloneable { - private static final TStruct STRUCT_DESC = new TStruct("get_partitions_args"); + public static class get_column_privilege_set_args implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("get_column_privilege_set_args"); private static final TField DB_NAME_FIELD_DESC = new TField("db_name", TType.STRING, (short)1); - private static final TField TBL_NAME_FIELD_DESC = new TField("tbl_name", TType.STRING, (short)2); - private static final TField MAX_PARTS_FIELD_DESC = new TField("max_parts", TType.I16, (short)3); + private static final TField TABLE_NAME_FIELD_DESC = new TField("table_name", TType.STRING, (short)2); + private static final TField PART_NAME_FIELD_DESC = new TField("part_name", TType.STRING, (short)3); + private static final TField COLUMN_NAME_FIELD_DESC = new TField("column_name", TType.STRING, (short)4); + private static final TField USER_NAME_FIELD_DESC = new TField("user_name", TType.STRING, (short)5); + private static final TField GROUP_NAMES_FIELD_DESC = new TField("group_names", TType.LIST, (short)6); private String db_name; public static final int DB_NAME = 1; - private String tbl_name; - public static final int TBL_NAME = 2; - private short max_parts; - public static final int MAX_PARTS = 3; + private String table_name; + public static final int TABLE_NAME = 2; + private String part_name; + public static final int PART_NAME = 3; + private String column_name; + public static final int COLUMN_NAME = 4; + private String user_name; + public static final int USER_NAME = 5; + private List group_names; + public static final int GROUP_NAMES = 6; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { - public boolean max_parts = false; } public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ put(DB_NAME, new FieldMetaData("db_name", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRING))); - put(TBL_NAME, new FieldMetaData("tbl_name", TFieldRequirementType.DEFAULT, + put(TABLE_NAME, new FieldMetaData("table_name", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRING))); - put(MAX_PARTS, new FieldMetaData("max_parts", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.I16))); + put(PART_NAME, new FieldMetaData("part_name", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + put(COLUMN_NAME, new FieldMetaData("column_name", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + put(USER_NAME, new FieldMetaData("user_name", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + put(GROUP_NAMES, new FieldMetaData("group_names", TFieldRequirementType.DEFAULT, + new ListMetaData(TType.LIST, + new FieldValueMetaData(TType.STRING)))); }}); static { - FieldMetaData.addStructMetaDataMap(get_partitions_args.class, metaDataMap); + FieldMetaData.addStructMetaDataMap(get_column_privilege_set_args.class, metaDataMap); } - public get_partitions_args() { - this.max_parts = (short)-1; - + public get_column_privilege_set_args() { } - public get_partitions_args( + public get_column_privilege_set_args( String db_name, - String tbl_name, - short max_parts) + String table_name, + String part_name, + String column_name, + String user_name, + List group_names) { this(); this.db_name = db_name; - this.tbl_name = tbl_name; - this.max_parts = max_parts; - this.__isset.max_parts = true; + this.table_name = table_name; + this.part_name = part_name; + this.column_name = column_name; + this.user_name = user_name; + this.group_names = group_names; } /** * Performs a deep copy on other. */ - public get_partitions_args(get_partitions_args other) { + public get_column_privilege_set_args(get_column_privilege_set_args other) { if (other.isSetDb_name()) { this.db_name = other.db_name; } - if (other.isSetTbl_name()) { - this.tbl_name = other.tbl_name; + if (other.isSetTable_name()) { + this.table_name = other.table_name; } - __isset.max_parts = other.__isset.max_parts; - this.max_parts = other.max_parts; + if (other.isSetPart_name()) { + this.part_name = other.part_name; + } + if (other.isSetColumn_name()) { + this.column_name = other.column_name; + } + if (other.isSetUser_name()) { + this.user_name = other.user_name; + } + if (other.isSetGroup_names()) { + List __this__group_names = new ArrayList(); + for (String other_element : other.group_names) { + __this__group_names.add(other_element); + } + this.group_names = __this__group_names; + } } @Override - public get_partitions_args clone() { - return new get_partitions_args(this); + public get_column_privilege_set_args clone() { + return new get_column_privilege_set_args(this); } public String getDb_name() { @@ -17257,39 +30108,104 @@ return this.db_name != null; } - public String getTbl_name() { - return this.tbl_name; + public String getTable_name() { + return this.table_name; } - public void setTbl_name(String tbl_name) { - this.tbl_name = tbl_name; + public void setTable_name(String table_name) { + this.table_name = table_name; } - public void unsetTbl_name() { - this.tbl_name = null; + public void unsetTable_name() { + this.table_name = null; } - // Returns true if field tbl_name is set (has been asigned a value) and false otherwise - public boolean isSetTbl_name() { - return this.tbl_name != null; + // Returns true if field table_name is set (has been asigned a value) and false otherwise + public boolean isSetTable_name() { + return this.table_name != null; } - public short getMax_parts() { - return this.max_parts; + public String getPart_name() { + return this.part_name; } - public void setMax_parts(short max_parts) { - this.max_parts = max_parts; - this.__isset.max_parts = true; + public void setPart_name(String part_name) { + this.part_name = part_name; } - public void unsetMax_parts() { - this.__isset.max_parts = false; + public void unsetPart_name() { + this.part_name = null; } - // Returns true if field max_parts is set (has been asigned a value) and false otherwise - public boolean isSetMax_parts() { - return this.__isset.max_parts; + // Returns true if field part_name is set (has been asigned a value) and false otherwise + public boolean isSetPart_name() { + return this.part_name != null; + } + + public String getColumn_name() { + return this.column_name; + } + + public void setColumn_name(String column_name) { + this.column_name = column_name; + } + + public void unsetColumn_name() { + this.column_name = null; + } + + // Returns true if field column_name is set (has been asigned a value) and false otherwise + public boolean isSetColumn_name() { + return this.column_name != null; + } + + public String getUser_name() { + return this.user_name; + } + + public void setUser_name(String user_name) { + this.user_name = user_name; + } + + public void unsetUser_name() { + this.user_name = null; + } + + // Returns true if field user_name is set (has been asigned a value) and false otherwise + public boolean isSetUser_name() { + return this.user_name != null; + } + + public int getGroup_namesSize() { + return (this.group_names == null) ? 0 : this.group_names.size(); + } + + public java.util.Iterator getGroup_namesIterator() { + return (this.group_names == null) ? null : this.group_names.iterator(); + } + + public void addToGroup_names(String elem) { + if (this.group_names == null) { + this.group_names = new ArrayList(); + } + this.group_names.add(elem); + } + + public List getGroup_names() { + return this.group_names; + } + + public void setGroup_names(List group_names) { + this.group_names = group_names; + } + + public void unsetGroup_names() { + this.group_names = null; + } + + // Returns true if field group_names is set (has been asigned a value) and false otherwise + public boolean isSetGroup_names() { + return this.group_names != null; } public void setFieldValue(int fieldID, Object value) { @@ -17302,19 +30218,43 @@ } break; - case TBL_NAME: + case TABLE_NAME: if (value == null) { - unsetTbl_name(); + unsetTable_name(); } else { - setTbl_name((String)value); + setTable_name((String)value); } break; - case MAX_PARTS: + case PART_NAME: if (value == null) { - unsetMax_parts(); + unsetPart_name(); } else { - setMax_parts((Short)value); + setPart_name((String)value); + } + break; + + case COLUMN_NAME: + if (value == null) { + unsetColumn_name(); + } else { + setColumn_name((String)value); + } + break; + + case USER_NAME: + if (value == null) { + unsetUser_name(); + } else { + setUser_name((String)value); + } + break; + + case GROUP_NAMES: + if (value == null) { + unsetGroup_names(); + } else { + setGroup_names((List)value); } break; @@ -17328,11 +30268,20 @@ case DB_NAME: return getDb_name(); - case TBL_NAME: - return getTbl_name(); + case TABLE_NAME: + return getTable_name(); - case MAX_PARTS: - return new Short(getMax_parts()); + case PART_NAME: + return getPart_name(); + + case COLUMN_NAME: + return getColumn_name(); + + case USER_NAME: + return getUser_name(); + + case GROUP_NAMES: + return getGroup_names(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); @@ -17344,10 +30293,16 @@ switch (fieldID) { case DB_NAME: return isSetDb_name(); - case TBL_NAME: - return isSetTbl_name(); - case MAX_PARTS: - return isSetMax_parts(); + case TABLE_NAME: + return isSetTable_name(); + case PART_NAME: + return isSetPart_name(); + case COLUMN_NAME: + return isSetColumn_name(); + case USER_NAME: + return isSetUser_name(); + case GROUP_NAMES: + return isSetGroup_names(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -17357,12 +30312,12 @@ public boolean equals(Object that) { if (that == null) return false; - if (that instanceof get_partitions_args) - return this.equals((get_partitions_args)that); + if (that instanceof get_column_privilege_set_args) + return this.equals((get_column_privilege_set_args)that); return false; } - public boolean equals(get_partitions_args that) { + public boolean equals(get_column_privilege_set_args that) { if (that == null) return false; @@ -17375,21 +30330,48 @@ return false; } - boolean this_present_tbl_name = true && this.isSetTbl_name(); - boolean that_present_tbl_name = true && that.isSetTbl_name(); - if (this_present_tbl_name || that_present_tbl_name) { - if (!(this_present_tbl_name && that_present_tbl_name)) + boolean this_present_table_name = true && this.isSetTable_name(); + boolean that_present_table_name = true && that.isSetTable_name(); + if (this_present_table_name || that_present_table_name) { + if (!(this_present_table_name && that_present_table_name)) return false; - if (!this.tbl_name.equals(that.tbl_name)) + if (!this.table_name.equals(that.table_name)) return false; } - boolean this_present_max_parts = true; - boolean that_present_max_parts = true; - if (this_present_max_parts || that_present_max_parts) { - if (!(this_present_max_parts && that_present_max_parts)) + boolean this_present_part_name = true && this.isSetPart_name(); + boolean that_present_part_name = true && that.isSetPart_name(); + if (this_present_part_name || that_present_part_name) { + if (!(this_present_part_name && that_present_part_name)) return false; - if (this.max_parts != that.max_parts) + if (!this.part_name.equals(that.part_name)) + return false; + } + + boolean this_present_column_name = true && this.isSetColumn_name(); + boolean that_present_column_name = true && that.isSetColumn_name(); + if (this_present_column_name || that_present_column_name) { + if (!(this_present_column_name && that_present_column_name)) + return false; + if (!this.column_name.equals(that.column_name)) + return false; + } + + boolean this_present_user_name = true && this.isSetUser_name(); + boolean that_present_user_name = true && that.isSetUser_name(); + if (this_present_user_name || that_present_user_name) { + if (!(this_present_user_name && that_present_user_name)) + return false; + if (!this.user_name.equals(that.user_name)) + return false; + } + + boolean this_present_group_names = true && this.isSetGroup_names(); + boolean that_present_group_names = true && that.isSetGroup_names(); + if (this_present_group_names || that_present_group_names) { + if (!(this_present_group_names && that_present_group_names)) + return false; + if (!this.group_names.equals(that.group_names)) return false; } @@ -17419,17 +30401,47 @@ TProtocolUtil.skip(iprot, field.type); } break; - case TBL_NAME: + case TABLE_NAME: if (field.type == TType.STRING) { - this.tbl_name = iprot.readString(); + this.table_name = iprot.readString(); } else { TProtocolUtil.skip(iprot, field.type); } break; - case MAX_PARTS: - if (field.type == TType.I16) { - this.max_parts = iprot.readI16(); - this.__isset.max_parts = true; + case PART_NAME: + if (field.type == TType.STRING) { + this.part_name = iprot.readString(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case COLUMN_NAME: + if (field.type == TType.STRING) { + this.column_name = iprot.readString(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case USER_NAME: + if (field.type == TType.STRING) { + this.user_name = iprot.readString(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case GROUP_NAMES: + if (field.type == TType.LIST) { + { + TList _list199 = iprot.readListBegin(); + this.group_names = new ArrayList(_list199.size); + for (int _i200 = 0; _i200 < _list199.size; ++_i200) + { + String _elem201; + _elem201 = iprot.readString(); + this.group_names.add(_elem201); + } + iprot.readListEnd(); + } } else { TProtocolUtil.skip(iprot, field.type); } @@ -17454,21 +30466,44 @@ oprot.writeString(this.db_name); oprot.writeFieldEnd(); } - if (this.tbl_name != null) { - oprot.writeFieldBegin(TBL_NAME_FIELD_DESC); - oprot.writeString(this.tbl_name); + if (this.table_name != null) { + oprot.writeFieldBegin(TABLE_NAME_FIELD_DESC); + oprot.writeString(this.table_name); oprot.writeFieldEnd(); } - oprot.writeFieldBegin(MAX_PARTS_FIELD_DESC); - oprot.writeI16(this.max_parts); - oprot.writeFieldEnd(); + if (this.part_name != null) { + oprot.writeFieldBegin(PART_NAME_FIELD_DESC); + oprot.writeString(this.part_name); + oprot.writeFieldEnd(); + } + if (this.column_name != null) { + oprot.writeFieldBegin(COLUMN_NAME_FIELD_DESC); + oprot.writeString(this.column_name); + oprot.writeFieldEnd(); + } + if (this.user_name != null) { + oprot.writeFieldBegin(USER_NAME_FIELD_DESC); + oprot.writeString(this.user_name); + oprot.writeFieldEnd(); + } + if (this.group_names != null) { + oprot.writeFieldBegin(GROUP_NAMES_FIELD_DESC); + { + oprot.writeListBegin(new TList(TType.STRING, this.group_names.size())); + for (String _iter202 : this.group_names) { + oprot.writeString(_iter202); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } oprot.writeFieldStop(); oprot.writeStructEnd(); } @Override public String toString() { - StringBuilder sb = new StringBuilder("get_partitions_args("); + StringBuilder sb = new StringBuilder("get_column_privilege_set_args("); boolean first = true; sb.append("db_name:"); @@ -17479,16 +30514,44 @@ } first = false; if (!first) sb.append(", "); - sb.append("tbl_name:"); - if (this.tbl_name == null) { + sb.append("table_name:"); + if (this.table_name == null) { sb.append("null"); } else { - sb.append(this.tbl_name); + sb.append(this.table_name); } first = false; if (!first) sb.append(", "); - sb.append("max_parts:"); - sb.append(this.max_parts); + sb.append("part_name:"); + if (this.part_name == null) { + sb.append("null"); + } else { + sb.append(this.part_name); + } + first = false; + if (!first) sb.append(", "); + sb.append("column_name:"); + if (this.column_name == null) { + sb.append("null"); + } else { + sb.append(this.column_name); + } + first = false; + if (!first) sb.append(", "); + sb.append("user_name:"); + if (this.user_name == null) { + sb.append("null"); + } else { + sb.append(this.user_name); + } + first = false; + if (!first) sb.append(", "); + sb.append("group_names:"); + if (this.group_names == null) { + sb.append("null"); + } else { + sb.append(this.group_names); + } first = false; sb.append(")"); return sb.toString(); @@ -17501,18 +30564,15 @@ } - public static class get_partitions_result implements TBase, java.io.Serializable, Cloneable { - private static final TStruct STRUCT_DESC = new TStruct("get_partitions_result"); - private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.LIST, (short)0); + public static class get_column_privilege_set_result implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("get_column_privilege_set_result"); + private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.STRUCT, (short)0); private static final TField O1_FIELD_DESC = new TField("o1", TType.STRUCT, (short)1); - private static final TField O2_FIELD_DESC = new TField("o2", TType.STRUCT, (short)2); - private List success; + private PrincipalPrivilegeSet success; public static final int SUCCESS = 0; - private NoSuchObjectException o1; + private MetaException o1; public static final int O1 = 1; - private MetaException o2; - public static final int O2 = 2; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { @@ -17520,76 +30580,49 @@ public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ put(SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, - new ListMetaData(TType.LIST, - new StructMetaData(TType.STRUCT, Partition.class)))); + new StructMetaData(TType.STRUCT, PrincipalPrivilegeSet.class))); put(O1, new FieldMetaData("o1", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRUCT))); - put(O2, new FieldMetaData("o2", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRUCT))); }}); static { - FieldMetaData.addStructMetaDataMap(get_partitions_result.class, metaDataMap); + FieldMetaData.addStructMetaDataMap(get_column_privilege_set_result.class, metaDataMap); } - public get_partitions_result() { + public get_column_privilege_set_result() { } - public get_partitions_result( - List success, - NoSuchObjectException o1, - MetaException o2) + public get_column_privilege_set_result( + PrincipalPrivilegeSet success, + MetaException o1) { this(); this.success = success; this.o1 = o1; - this.o2 = o2; } /** * Performs a deep copy on other. */ - public get_partitions_result(get_partitions_result other) { + public get_column_privilege_set_result(get_column_privilege_set_result other) { if (other.isSetSuccess()) { - List __this__success = new ArrayList(); - for (Partition other_element : other.success) { - __this__success.add(new Partition(other_element)); - } - this.success = __this__success; + this.success = new PrincipalPrivilegeSet(other.success); } if (other.isSetO1()) { - this.o1 = new NoSuchObjectException(other.o1); - } - if (other.isSetO2()) { - this.o2 = new MetaException(other.o2); + this.o1 = new MetaException(other.o1); } } @Override - public get_partitions_result clone() { - return new get_partitions_result(this); - } - - public int getSuccessSize() { - return (this.success == null) ? 0 : this.success.size(); - } - - public java.util.Iterator getSuccessIterator() { - return (this.success == null) ? null : this.success.iterator(); - } - - public void addToSuccess(Partition elem) { - if (this.success == null) { - this.success = new ArrayList(); - } - this.success.add(elem); + public get_column_privilege_set_result clone() { + return new get_column_privilege_set_result(this); } - public List getSuccess() { + public PrincipalPrivilegeSet getSuccess() { return this.success; } - public void setSuccess(List success) { + public void setSuccess(PrincipalPrivilegeSet success) { this.success = success; } @@ -17602,38 +30635,21 @@ return this.success != null; } - public NoSuchObjectException getO1() { - return this.o1; - } - - public void setO1(NoSuchObjectException o1) { - this.o1 = o1; - } - - public void unsetO1() { - this.o1 = null; - } - - // Returns true if field o1 is set (has been asigned a value) and false otherwise - public boolean isSetO1() { - return this.o1 != null; - } - - public MetaException getO2() { - return this.o2; + public MetaException getO1() { + return this.o1; } - public void setO2(MetaException o2) { - this.o2 = o2; + public void setO1(MetaException o1) { + this.o1 = o1; } - public void unsetO2() { - this.o2 = null; + public void unsetO1() { + this.o1 = null; } - // Returns true if field o2 is set (has been asigned a value) and false otherwise - public boolean isSetO2() { - return this.o2 != null; + // Returns true if field o1 is set (has been asigned a value) and false otherwise + public boolean isSetO1() { + return this.o1 != null; } public void setFieldValue(int fieldID, Object value) { @@ -17642,7 +30658,7 @@ if (value == null) { unsetSuccess(); } else { - setSuccess((List)value); + setSuccess((PrincipalPrivilegeSet)value); } break; @@ -17650,15 +30666,7 @@ if (value == null) { unsetO1(); } else { - setO1((NoSuchObjectException)value); - } - break; - - case O2: - if (value == null) { - unsetO2(); - } else { - setO2((MetaException)value); + setO1((MetaException)value); } break; @@ -17675,9 +30683,6 @@ case O1: return getO1(); - case O2: - return getO2(); - default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -17690,8 +30695,6 @@ return isSetSuccess(); case O1: return isSetO1(); - case O2: - return isSetO2(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -17701,12 +30704,12 @@ public boolean equals(Object that) { if (that == null) return false; - if (that instanceof get_partitions_result) - return this.equals((get_partitions_result)that); + if (that instanceof get_column_privilege_set_result) + return this.equals((get_column_privilege_set_result)that); return false; } - public boolean equals(get_partitions_result that) { + public boolean equals(get_column_privilege_set_result that) { if (that == null) return false; @@ -17728,15 +30731,6 @@ return false; } - boolean this_present_o2 = true && this.isSetO2(); - boolean that_present_o2 = true && that.isSetO2(); - if (this_present_o2 || that_present_o2) { - if (!(this_present_o2 && that_present_o2)) - return false; - if (!this.o2.equals(that.o2)) - return false; - } - return true; } @@ -17757,39 +30751,21 @@ switch (field.id) { case SUCCESS: - if (field.type == TType.LIST) { - { - TList _list99 = iprot.readListBegin(); - this.success = new ArrayList(_list99.size); - for (int _i100 = 0; _i100 < _list99.size; ++_i100) - { - Partition _elem101; - _elem101 = new Partition(); - _elem101.read(iprot); - this.success.add(_elem101); - } - iprot.readListEnd(); - } + if (field.type == TType.STRUCT) { + this.success = new PrincipalPrivilegeSet(); + this.success.read(iprot); } else { TProtocolUtil.skip(iprot, field.type); } break; case O1: if (field.type == TType.STRUCT) { - this.o1 = new NoSuchObjectException(); + this.o1 = new MetaException(); this.o1.read(iprot); } else { TProtocolUtil.skip(iprot, field.type); } break; - case O2: - if (field.type == TType.STRUCT) { - this.o2 = new MetaException(); - this.o2.read(iprot); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; default: TProtocolUtil.skip(iprot, field.type); break; @@ -17806,22 +30782,12 @@ if (this.isSetSuccess()) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - { - oprot.writeListBegin(new TList(TType.STRUCT, this.success.size())); - for (Partition _iter102 : this.success) { - _iter102.write(oprot); - } - oprot.writeListEnd(); - } + this.success.write(oprot); oprot.writeFieldEnd(); } else if (this.isSetO1()) { oprot.writeFieldBegin(O1_FIELD_DESC); this.o1.write(oprot); oprot.writeFieldEnd(); - } else if (this.isSetO2()) { - oprot.writeFieldBegin(O2_FIELD_DESC); - this.o2.write(oprot); - oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); @@ -17829,7 +30795,7 @@ @Override public String toString() { - StringBuilder sb = new StringBuilder("get_partitions_result("); + StringBuilder sb = new StringBuilder("get_column_privilege_set_result("); boolean first = true; sb.append("success:"); @@ -17847,14 +30813,6 @@ sb.append(this.o1); } first = false; - if (!first) sb.append(", "); - sb.append("o2:"); - if (this.o2 == null) { - sb.append("null"); - } else { - sb.append(this.o2); - } - first = false; sb.append(")"); return sb.toString(); } @@ -17866,148 +30824,109 @@ } - public static class get_partition_names_args implements TBase, java.io.Serializable, Cloneable { - private static final TStruct STRUCT_DESC = new TStruct("get_partition_names_args"); - private static final TField DB_NAME_FIELD_DESC = new TField("db_name", TType.STRING, (short)1); - private static final TField TBL_NAME_FIELD_DESC = new TField("tbl_name", TType.STRING, (short)2); - private static final TField MAX_PARTS_FIELD_DESC = new TField("max_parts", TType.I16, (short)3); + public static class create_role_args implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("create_role_args"); + private static final TField ROLE_NAME_FIELD_DESC = new TField("role_name", TType.STRING, (short)1); + private static final TField OWNER_NAME_FIELD_DESC = new TField("owner_name", TType.STRING, (short)2); - private String db_name; - public static final int DB_NAME = 1; - private String tbl_name; - public static final int TBL_NAME = 2; - private short max_parts; - public static final int MAX_PARTS = 3; + private String role_name; + public static final int ROLE_NAME = 1; + private String owner_name; + public static final int OWNER_NAME = 2; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { - public boolean max_parts = false; } public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ - put(DB_NAME, new FieldMetaData("db_name", TFieldRequirementType.DEFAULT, + put(ROLE_NAME, new FieldMetaData("role_name", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRING))); - put(TBL_NAME, new FieldMetaData("tbl_name", TFieldRequirementType.DEFAULT, + put(OWNER_NAME, new FieldMetaData("owner_name", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRING))); - put(MAX_PARTS, new FieldMetaData("max_parts", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.I16))); }}); static { - FieldMetaData.addStructMetaDataMap(get_partition_names_args.class, metaDataMap); + FieldMetaData.addStructMetaDataMap(create_role_args.class, metaDataMap); } - public get_partition_names_args() { - this.max_parts = (short)-1; - + public create_role_args() { } - public get_partition_names_args( - String db_name, - String tbl_name, - short max_parts) + public create_role_args( + String role_name, + String owner_name) { this(); - this.db_name = db_name; - this.tbl_name = tbl_name; - this.max_parts = max_parts; - this.__isset.max_parts = true; + this.role_name = role_name; + this.owner_name = owner_name; } /** * Performs a deep copy on other. */ - public get_partition_names_args(get_partition_names_args other) { - if (other.isSetDb_name()) { - this.db_name = other.db_name; + public create_role_args(create_role_args other) { + if (other.isSetRole_name()) { + this.role_name = other.role_name; } - if (other.isSetTbl_name()) { - this.tbl_name = other.tbl_name; + if (other.isSetOwner_name()) { + this.owner_name = other.owner_name; } - __isset.max_parts = other.__isset.max_parts; - this.max_parts = other.max_parts; } @Override - public get_partition_names_args clone() { - return new get_partition_names_args(this); - } - - public String getDb_name() { - return this.db_name; - } - - public void setDb_name(String db_name) { - this.db_name = db_name; - } - - public void unsetDb_name() { - this.db_name = null; - } - - // Returns true if field db_name is set (has been asigned a value) and false otherwise - public boolean isSetDb_name() { - return this.db_name != null; + public create_role_args clone() { + return new create_role_args(this); } - public String getTbl_name() { - return this.tbl_name; + public String getRole_name() { + return this.role_name; } - public void setTbl_name(String tbl_name) { - this.tbl_name = tbl_name; + public void setRole_name(String role_name) { + this.role_name = role_name; } - public void unsetTbl_name() { - this.tbl_name = null; + public void unsetRole_name() { + this.role_name = null; } - // Returns true if field tbl_name is set (has been asigned a value) and false otherwise - public boolean isSetTbl_name() { - return this.tbl_name != null; + // Returns true if field role_name is set (has been asigned a value) and false otherwise + public boolean isSetRole_name() { + return this.role_name != null; } - public short getMax_parts() { - return this.max_parts; + public String getOwner_name() { + return this.owner_name; } - public void setMax_parts(short max_parts) { - this.max_parts = max_parts; - this.__isset.max_parts = true; + public void setOwner_name(String owner_name) { + this.owner_name = owner_name; } - public void unsetMax_parts() { - this.__isset.max_parts = false; + public void unsetOwner_name() { + this.owner_name = null; } - // Returns true if field max_parts is set (has been asigned a value) and false otherwise - public boolean isSetMax_parts() { - return this.__isset.max_parts; + // Returns true if field owner_name is set (has been asigned a value) and false otherwise + public boolean isSetOwner_name() { + return this.owner_name != null; } public void setFieldValue(int fieldID, Object value) { switch (fieldID) { - case DB_NAME: - if (value == null) { - unsetDb_name(); - } else { - setDb_name((String)value); - } - break; - - case TBL_NAME: + case ROLE_NAME: if (value == null) { - unsetTbl_name(); + unsetRole_name(); } else { - setTbl_name((String)value); + setRole_name((String)value); } break; - case MAX_PARTS: + case OWNER_NAME: if (value == null) { - unsetMax_parts(); + unsetOwner_name(); } else { - setMax_parts((Short)value); + setOwner_name((String)value); } break; @@ -18018,14 +30937,11 @@ public Object getFieldValue(int fieldID) { switch (fieldID) { - case DB_NAME: - return getDb_name(); - - case TBL_NAME: - return getTbl_name(); + case ROLE_NAME: + return getRole_name(); - case MAX_PARTS: - return new Short(getMax_parts()); + case OWNER_NAME: + return getOwner_name(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); @@ -18035,12 +30951,10 @@ // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise public boolean isSet(int fieldID) { switch (fieldID) { - case DB_NAME: - return isSetDb_name(); - case TBL_NAME: - return isSetTbl_name(); - case MAX_PARTS: - return isSetMax_parts(); + case ROLE_NAME: + return isSetRole_name(); + case OWNER_NAME: + return isSetOwner_name(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -18050,39 +30964,30 @@ public boolean equals(Object that) { if (that == null) return false; - if (that instanceof get_partition_names_args) - return this.equals((get_partition_names_args)that); + if (that instanceof create_role_args) + return this.equals((create_role_args)that); return false; } - public boolean equals(get_partition_names_args that) { + public boolean equals(create_role_args that) { if (that == null) 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) { - if (!(this_present_db_name && that_present_db_name)) - return false; - if (!this.db_name.equals(that.db_name)) - return false; - } - - boolean this_present_tbl_name = true && this.isSetTbl_name(); - boolean that_present_tbl_name = true && that.isSetTbl_name(); - if (this_present_tbl_name || that_present_tbl_name) { - if (!(this_present_tbl_name && that_present_tbl_name)) + boolean this_present_role_name = true && this.isSetRole_name(); + boolean that_present_role_name = true && that.isSetRole_name(); + if (this_present_role_name || that_present_role_name) { + if (!(this_present_role_name && that_present_role_name)) return false; - if (!this.tbl_name.equals(that.tbl_name)) + if (!this.role_name.equals(that.role_name)) return false; } - boolean this_present_max_parts = true; - boolean that_present_max_parts = true; - if (this_present_max_parts || that_present_max_parts) { - if (!(this_present_max_parts && that_present_max_parts)) + boolean this_present_owner_name = true && this.isSetOwner_name(); + boolean that_present_owner_name = true && that.isSetOwner_name(); + if (this_present_owner_name || that_present_owner_name) { + if (!(this_present_owner_name && that_present_owner_name)) return false; - if (this.max_parts != that.max_parts) + if (!this.owner_name.equals(that.owner_name)) return false; } @@ -18105,24 +31010,16 @@ } switch (field.id) { - case DB_NAME: + case ROLE_NAME: if (field.type == TType.STRING) { - this.db_name = iprot.readString(); + this.role_name = iprot.readString(); } else { TProtocolUtil.skip(iprot, field.type); } break; - case TBL_NAME: + case OWNER_NAME: if (field.type == TType.STRING) { - this.tbl_name = iprot.readString(); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - case MAX_PARTS: - if (field.type == TType.I16) { - this.max_parts = iprot.readI16(); - this.__isset.max_parts = true; + this.owner_name = iprot.readString(); } else { TProtocolUtil.skip(iprot, field.type); } @@ -18142,47 +31039,40 @@ validate(); oprot.writeStructBegin(STRUCT_DESC); - if (this.db_name != null) { - oprot.writeFieldBegin(DB_NAME_FIELD_DESC); - oprot.writeString(this.db_name); + if (this.role_name != null) { + oprot.writeFieldBegin(ROLE_NAME_FIELD_DESC); + oprot.writeString(this.role_name); oprot.writeFieldEnd(); } - if (this.tbl_name != null) { - oprot.writeFieldBegin(TBL_NAME_FIELD_DESC); - oprot.writeString(this.tbl_name); + if (this.owner_name != null) { + oprot.writeFieldBegin(OWNER_NAME_FIELD_DESC); + oprot.writeString(this.owner_name); oprot.writeFieldEnd(); } - oprot.writeFieldBegin(MAX_PARTS_FIELD_DESC); - oprot.writeI16(this.max_parts); - oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } @Override public String toString() { - StringBuilder sb = new StringBuilder("get_partition_names_args("); + StringBuilder sb = new StringBuilder("create_role_args("); boolean first = true; - sb.append("db_name:"); - if (this.db_name == null) { + sb.append("role_name:"); + if (this.role_name == null) { sb.append("null"); } else { - sb.append(this.db_name); + sb.append(this.role_name); } first = false; if (!first) sb.append(", "); - sb.append("tbl_name:"); - if (this.tbl_name == null) { + sb.append("owner_name:"); + if (this.owner_name == null) { sb.append("null"); } else { - sb.append(this.tbl_name); + sb.append(this.owner_name); } first = false; - if (!first) sb.append(", "); - sb.append("max_parts:"); - sb.append(this.max_parts); - first = false; sb.append(")"); return sb.toString(); } @@ -18194,112 +31084,94 @@ } - public static class get_partition_names_result implements TBase, java.io.Serializable, Cloneable { - private static final TStruct STRUCT_DESC = new TStruct("get_partition_names_result"); - private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.LIST, (short)0); - private static final TField O2_FIELD_DESC = new TField("o2", TType.STRUCT, (short)1); + public static class create_role_result implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("create_role_result"); + private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.BOOL, (short)0); + private static final TField O1_FIELD_DESC = new TField("o1", TType.STRUCT, (short)1); - private List success; + private boolean success; public static final int SUCCESS = 0; - private MetaException o2; - public static final int O2 = 1; + private MetaException o1; + public static final int O1 = 1; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { + public boolean success = false; } public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ put(SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, - new ListMetaData(TType.LIST, - new FieldValueMetaData(TType.STRING)))); - put(O2, new FieldMetaData("o2", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.BOOL))); + put(O1, new FieldMetaData("o1", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRUCT))); }}); static { - FieldMetaData.addStructMetaDataMap(get_partition_names_result.class, metaDataMap); + FieldMetaData.addStructMetaDataMap(create_role_result.class, metaDataMap); } - public get_partition_names_result() { + public create_role_result() { } - public get_partition_names_result( - List success, - MetaException o2) + public create_role_result( + boolean success, + MetaException o1) { this(); this.success = success; - this.o2 = o2; + this.__isset.success = true; + this.o1 = o1; } /** * Performs a deep copy on other. */ - public get_partition_names_result(get_partition_names_result other) { - if (other.isSetSuccess()) { - List __this__success = new ArrayList(); - for (String other_element : other.success) { - __this__success.add(other_element); - } - this.success = __this__success; - } - if (other.isSetO2()) { - this.o2 = new MetaException(other.o2); + public create_role_result(create_role_result other) { + __isset.success = other.__isset.success; + this.success = other.success; + if (other.isSetO1()) { + this.o1 = new MetaException(other.o1); } } @Override - public get_partition_names_result clone() { - return new get_partition_names_result(this); - } - - public int getSuccessSize() { - return (this.success == null) ? 0 : this.success.size(); - } - - public java.util.Iterator getSuccessIterator() { - return (this.success == null) ? null : this.success.iterator(); - } - - public void addToSuccess(String elem) { - if (this.success == null) { - this.success = new ArrayList(); - } - this.success.add(elem); + public create_role_result clone() { + return new create_role_result(this); } - public List getSuccess() { + public boolean isSuccess() { return this.success; } - public void setSuccess(List success) { + public void setSuccess(boolean success) { this.success = success; + this.__isset.success = true; } public void unsetSuccess() { - this.success = null; + this.__isset.success = false; } // Returns true if field success is set (has been asigned a value) and false otherwise public boolean isSetSuccess() { - return this.success != null; + return this.__isset.success; } - public MetaException getO2() { - return this.o2; + public MetaException getO1() { + return this.o1; } - public void setO2(MetaException o2) { - this.o2 = o2; + public void setO1(MetaException o1) { + this.o1 = o1; } - public void unsetO2() { - this.o2 = null; + public void unsetO1() { + this.o1 = null; } - // Returns true if field o2 is set (has been asigned a value) and false otherwise - public boolean isSetO2() { - return this.o2 != null; + // Returns true if field o1 is set (has been asigned a value) and false otherwise + public boolean isSetO1() { + return this.o1 != null; } public void setFieldValue(int fieldID, Object value) { @@ -18308,15 +31180,15 @@ if (value == null) { unsetSuccess(); } else { - setSuccess((List)value); + setSuccess((Boolean)value); } break; - case O2: + case O1: if (value == null) { - unsetO2(); + unsetO1(); } else { - setO2((MetaException)value); + setO1((MetaException)value); } break; @@ -18328,10 +31200,10 @@ public Object getFieldValue(int fieldID) { switch (fieldID) { case SUCCESS: - return getSuccess(); + return new Boolean(isSuccess()); - case O2: - return getO2(); + case O1: + return getO1(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); @@ -18343,8 +31215,8 @@ switch (fieldID) { case SUCCESS: return isSetSuccess(); - case O2: - return isSetO2(); + case O1: + return isSetO1(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -18354,30 +31226,30 @@ public boolean equals(Object that) { if (that == null) return false; - if (that instanceof get_partition_names_result) - return this.equals((get_partition_names_result)that); + if (that instanceof create_role_result) + return this.equals((create_role_result)that); return false; } - public boolean equals(get_partition_names_result that) { + public boolean equals(create_role_result that) { if (that == null) return false; - boolean this_present_success = true && this.isSetSuccess(); - boolean that_present_success = true && that.isSetSuccess(); + boolean this_present_success = true; + boolean that_present_success = true; if (this_present_success || that_present_success) { if (!(this_present_success && that_present_success)) return false; - if (!this.success.equals(that.success)) + if (this.success != that.success) return false; } - boolean this_present_o2 = true && this.isSetO2(); - boolean that_present_o2 = true && that.isSetO2(); - if (this_present_o2 || that_present_o2) { - if (!(this_present_o2 && that_present_o2)) + boolean this_present_o1 = true && this.isSetO1(); + boolean that_present_o1 = true && that.isSetO1(); + if (this_present_o1 || that_present_o1) { + if (!(this_present_o1 && that_present_o1)) return false; - if (!this.o2.equals(that.o2)) + if (!this.o1.equals(that.o1)) return false; } @@ -18401,26 +31273,17 @@ switch (field.id) { case SUCCESS: - if (field.type == TType.LIST) { - { - TList _list103 = iprot.readListBegin(); - this.success = new ArrayList(_list103.size); - for (int _i104 = 0; _i104 < _list103.size; ++_i104) - { - String _elem105; - _elem105 = iprot.readString(); - this.success.add(_elem105); - } - iprot.readListEnd(); - } + if (field.type == TType.BOOL) { + this.success = iprot.readBool(); + this.__isset.success = true; } else { TProtocolUtil.skip(iprot, field.type); } break; - case O2: + case O1: if (field.type == TType.STRUCT) { - this.o2 = new MetaException(); - this.o2.read(iprot); + this.o1 = new MetaException(); + this.o1.read(iprot); } else { TProtocolUtil.skip(iprot, field.type); } @@ -18441,17 +31304,11 @@ if (this.isSetSuccess()) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - { - oprot.writeListBegin(new TList(TType.STRING, this.success.size())); - for (String _iter106 : this.success) { - oprot.writeString(_iter106); - } - oprot.writeListEnd(); - } + oprot.writeBool(this.success); oprot.writeFieldEnd(); - } else if (this.isSetO2()) { - oprot.writeFieldBegin(O2_FIELD_DESC); - this.o2.write(oprot); + } else if (this.isSetO1()) { + oprot.writeFieldBegin(O1_FIELD_DESC); + this.o1.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); @@ -18460,22 +31317,18 @@ @Override public String toString() { - StringBuilder sb = new StringBuilder("get_partition_names_result("); + StringBuilder sb = new StringBuilder("create_role_result("); boolean first = true; sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } + sb.append(this.success); first = false; if (!first) sb.append(", "); - sb.append("o2:"); - if (this.o2 == null) { + sb.append("o1:"); + if (this.o1 == null) { sb.append("null"); } else { - sb.append(this.o2); + sb.append(this.o1); } first = false; sb.append(")"); @@ -18489,203 +31342,74 @@ } - public static class get_partitions_ps_args implements TBase, java.io.Serializable, Cloneable { - private static final TStruct STRUCT_DESC = new TStruct("get_partitions_ps_args"); - private static final TField DB_NAME_FIELD_DESC = new TField("db_name", TType.STRING, (short)1); - private static final TField TBL_NAME_FIELD_DESC = new TField("tbl_name", TType.STRING, (short)2); - private static final TField PART_VALS_FIELD_DESC = new TField("part_vals", TType.LIST, (short)3); - private static final TField MAX_PARTS_FIELD_DESC = new TField("max_parts", TType.I16, (short)4); + public static class drop_role_args implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("drop_role_args"); + private static final TField ROLE_NAME_FIELD_DESC = new TField("role_name", TType.STRING, (short)1); - private String db_name; - public static final int DB_NAME = 1; - private String tbl_name; - public static final int TBL_NAME = 2; - private List part_vals; - public static final int PART_VALS = 3; - private short max_parts; - public static final int MAX_PARTS = 4; + private String role_name; + public static final int ROLE_NAME = 1; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { - public boolean max_parts = false; } public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ - put(DB_NAME, new FieldMetaData("db_name", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRING))); - put(TBL_NAME, new FieldMetaData("tbl_name", TFieldRequirementType.DEFAULT, + put(ROLE_NAME, new FieldMetaData("role_name", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRING))); - put(PART_VALS, new FieldMetaData("part_vals", TFieldRequirementType.DEFAULT, - new ListMetaData(TType.LIST, - new FieldValueMetaData(TType.STRING)))); - put(MAX_PARTS, new FieldMetaData("max_parts", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.I16))); }}); static { - FieldMetaData.addStructMetaDataMap(get_partitions_ps_args.class, metaDataMap); + FieldMetaData.addStructMetaDataMap(drop_role_args.class, metaDataMap); } - public get_partitions_ps_args() { - this.max_parts = (short)-1; - + public drop_role_args() { } - public get_partitions_ps_args( - String db_name, - String tbl_name, - List part_vals, - short max_parts) + public drop_role_args( + String role_name) { this(); - this.db_name = db_name; - this.tbl_name = tbl_name; - this.part_vals = part_vals; - this.max_parts = max_parts; - this.__isset.max_parts = true; + this.role_name = role_name; } /** * Performs a deep copy on other. */ - public get_partitions_ps_args(get_partitions_ps_args other) { - if (other.isSetDb_name()) { - this.db_name = other.db_name; - } - if (other.isSetTbl_name()) { - this.tbl_name = other.tbl_name; - } - if (other.isSetPart_vals()) { - List __this__part_vals = new ArrayList(); - for (String other_element : other.part_vals) { - __this__part_vals.add(other_element); - } - this.part_vals = __this__part_vals; + public drop_role_args(drop_role_args other) { + if (other.isSetRole_name()) { + this.role_name = other.role_name; } - __isset.max_parts = other.__isset.max_parts; - this.max_parts = other.max_parts; } @Override - public get_partitions_ps_args clone() { - return new get_partitions_ps_args(this); - } - - public String getDb_name() { - return this.db_name; - } - - public void setDb_name(String db_name) { - this.db_name = db_name; - } - - public void unsetDb_name() { - this.db_name = null; - } - - // Returns true if field db_name is set (has been asigned a value) and false otherwise - public boolean isSetDb_name() { - return this.db_name != null; - } - - public String getTbl_name() { - return this.tbl_name; - } - - public void setTbl_name(String tbl_name) { - this.tbl_name = tbl_name; - } - - public void unsetTbl_name() { - this.tbl_name = null; - } - - // Returns true if field tbl_name is set (has been asigned a value) and false otherwise - public boolean isSetTbl_name() { - return this.tbl_name != null; - } - - public int getPart_valsSize() { - return (this.part_vals == null) ? 0 : this.part_vals.size(); - } - - public java.util.Iterator getPart_valsIterator() { - return (this.part_vals == null) ? null : this.part_vals.iterator(); - } - - public void addToPart_vals(String elem) { - if (this.part_vals == null) { - this.part_vals = new ArrayList(); - } - this.part_vals.add(elem); - } - - public List getPart_vals() { - return this.part_vals; - } - - public void setPart_vals(List part_vals) { - this.part_vals = part_vals; - } - - public void unsetPart_vals() { - this.part_vals = null; - } - - // Returns true if field part_vals is set (has been asigned a value) and false otherwise - public boolean isSetPart_vals() { - return this.part_vals != null; + public drop_role_args clone() { + return new drop_role_args(this); } - public short getMax_parts() { - return this.max_parts; + public String getRole_name() { + return this.role_name; } - public void setMax_parts(short max_parts) { - this.max_parts = max_parts; - this.__isset.max_parts = true; + public void setRole_name(String role_name) { + this.role_name = role_name; } - public void unsetMax_parts() { - this.__isset.max_parts = false; + public void unsetRole_name() { + this.role_name = null; } - // Returns true if field max_parts is set (has been asigned a value) and false otherwise - public boolean isSetMax_parts() { - return this.__isset.max_parts; + // Returns true if field role_name is set (has been asigned a value) and false otherwise + public boolean isSetRole_name() { + return this.role_name != null; } public void setFieldValue(int fieldID, Object value) { switch (fieldID) { - case DB_NAME: - if (value == null) { - unsetDb_name(); - } else { - setDb_name((String)value); - } - break; - - case TBL_NAME: - if (value == null) { - unsetTbl_name(); - } else { - setTbl_name((String)value); - } - break; - - case PART_VALS: - if (value == null) { - unsetPart_vals(); - } else { - setPart_vals((List)value); - } - break; - - case MAX_PARTS: + case ROLE_NAME: if (value == null) { - unsetMax_parts(); + unsetRole_name(); } else { - setMax_parts((Short)value); + setRole_name((String)value); } break; @@ -18696,17 +31420,8 @@ public Object getFieldValue(int fieldID) { switch (fieldID) { - case DB_NAME: - return getDb_name(); - - case TBL_NAME: - return getTbl_name(); - - case PART_VALS: - return getPart_vals(); - - case MAX_PARTS: - return new Short(getMax_parts()); + case ROLE_NAME: + return getRole_name(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); @@ -18716,14 +31431,8 @@ // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise public boolean isSet(int fieldID) { switch (fieldID) { - case DB_NAME: - return isSetDb_name(); - case TBL_NAME: - return isSetTbl_name(); - case PART_VALS: - return isSetPart_vals(); - case MAX_PARTS: - return isSetMax_parts(); + case ROLE_NAME: + return isSetRole_name(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -18733,48 +31442,21 @@ public boolean equals(Object that) { if (that == null) return false; - if (that instanceof get_partitions_ps_args) - return this.equals((get_partitions_ps_args)that); + if (that instanceof drop_role_args) + return this.equals((drop_role_args)that); return false; } - public boolean equals(get_partitions_ps_args that) { + public boolean equals(drop_role_args that) { if (that == null) 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) { - if (!(this_present_db_name && that_present_db_name)) - return false; - if (!this.db_name.equals(that.db_name)) - return false; - } - - boolean this_present_tbl_name = true && this.isSetTbl_name(); - boolean that_present_tbl_name = true && that.isSetTbl_name(); - if (this_present_tbl_name || that_present_tbl_name) { - if (!(this_present_tbl_name && that_present_tbl_name)) - return false; - if (!this.tbl_name.equals(that.tbl_name)) - return false; - } - - boolean this_present_part_vals = true && this.isSetPart_vals(); - boolean that_present_part_vals = true && that.isSetPart_vals(); - if (this_present_part_vals || that_present_part_vals) { - if (!(this_present_part_vals && that_present_part_vals)) - return false; - if (!this.part_vals.equals(that.part_vals)) - return false; - } - - boolean this_present_max_parts = true; - boolean that_present_max_parts = true; - if (this_present_max_parts || that_present_max_parts) { - if (!(this_present_max_parts && that_present_max_parts)) + boolean this_present_role_name = true && this.isSetRole_name(); + boolean that_present_role_name = true && that.isSetRole_name(); + if (this_present_role_name || that_present_role_name) { + if (!(this_present_role_name && that_present_role_name)) return false; - if (this.max_parts != that.max_parts) + if (!this.role_name.equals(that.role_name)) return false; } @@ -18797,41 +31479,9 @@ } switch (field.id) { - case DB_NAME: - if (field.type == TType.STRING) { - this.db_name = iprot.readString(); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - case TBL_NAME: + case ROLE_NAME: if (field.type == TType.STRING) { - this.tbl_name = iprot.readString(); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - case PART_VALS: - if (field.type == TType.LIST) { - { - TList _list107 = iprot.readListBegin(); - this.part_vals = new ArrayList(_list107.size); - for (int _i108 = 0; _i108 < _list107.size; ++_i108) - { - String _elem109; - _elem109 = iprot.readString(); - this.part_vals.add(_elem109); - } - iprot.readListEnd(); - } - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - case MAX_PARTS: - if (field.type == TType.I16) { - this.max_parts = iprot.readI16(); - this.__isset.max_parts = true; + this.role_name = iprot.readString(); } else { TProtocolUtil.skip(iprot, field.type); } @@ -18851,66 +31501,27 @@ validate(); oprot.writeStructBegin(STRUCT_DESC); - if (this.db_name != null) { - oprot.writeFieldBegin(DB_NAME_FIELD_DESC); - oprot.writeString(this.db_name); - oprot.writeFieldEnd(); - } - if (this.tbl_name != null) { - oprot.writeFieldBegin(TBL_NAME_FIELD_DESC); - oprot.writeString(this.tbl_name); - oprot.writeFieldEnd(); - } - if (this.part_vals != null) { - oprot.writeFieldBegin(PART_VALS_FIELD_DESC); - { - oprot.writeListBegin(new TList(TType.STRING, this.part_vals.size())); - for (String _iter110 : this.part_vals) { - oprot.writeString(_iter110); - } - oprot.writeListEnd(); - } + if (this.role_name != null) { + oprot.writeFieldBegin(ROLE_NAME_FIELD_DESC); + oprot.writeString(this.role_name); oprot.writeFieldEnd(); } - oprot.writeFieldBegin(MAX_PARTS_FIELD_DESC); - oprot.writeI16(this.max_parts); - oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } @Override public String toString() { - StringBuilder sb = new StringBuilder("get_partitions_ps_args("); + StringBuilder sb = new StringBuilder("drop_role_args("); boolean first = true; - sb.append("db_name:"); - if (this.db_name == null) { - sb.append("null"); - } else { - sb.append(this.db_name); - } - first = false; - if (!first) sb.append(", "); - sb.append("tbl_name:"); - if (this.tbl_name == null) { - sb.append("null"); - } else { - sb.append(this.tbl_name); - } - first = false; - if (!first) sb.append(", "); - sb.append("part_vals:"); - if (this.part_vals == null) { + sb.append("role_name:"); + if (this.role_name == null) { sb.append("null"); } else { - sb.append(this.part_vals); + sb.append(this.role_name); } first = false; - if (!first) sb.append(", "); - sb.append("max_parts:"); - sb.append(this.max_parts); - first = false; sb.append(")"); return sb.toString(); } @@ -18922,95 +31533,77 @@ } - public static class get_partitions_ps_result implements TBase, java.io.Serializable, Cloneable { - private static final TStruct STRUCT_DESC = new TStruct("get_partitions_ps_result"); - private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.LIST, (short)0); + public static class drop_role_result implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("drop_role_result"); + private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.BOOL, (short)0); private static final TField O1_FIELD_DESC = new TField("o1", TType.STRUCT, (short)1); - private List success; + private boolean success; public static final int SUCCESS = 0; private MetaException o1; public static final int O1 = 1; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { + public boolean success = false; } public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ put(SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, - new ListMetaData(TType.LIST, - new StructMetaData(TType.STRUCT, Partition.class)))); + new FieldValueMetaData(TType.BOOL))); put(O1, new FieldMetaData("o1", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRUCT))); }}); static { - FieldMetaData.addStructMetaDataMap(get_partitions_ps_result.class, metaDataMap); + FieldMetaData.addStructMetaDataMap(drop_role_result.class, metaDataMap); } - public get_partitions_ps_result() { + public drop_role_result() { } - public get_partitions_ps_result( - List success, + public drop_role_result( + boolean success, MetaException o1) { this(); this.success = success; + this.__isset.success = true; this.o1 = o1; } /** * Performs a deep copy on other. */ - public get_partitions_ps_result(get_partitions_ps_result other) { - if (other.isSetSuccess()) { - List __this__success = new ArrayList(); - for (Partition other_element : other.success) { - __this__success.add(new Partition(other_element)); - } - this.success = __this__success; - } + public drop_role_result(drop_role_result other) { + __isset.success = other.__isset.success; + this.success = other.success; if (other.isSetO1()) { this.o1 = new MetaException(other.o1); } } @Override - public get_partitions_ps_result clone() { - return new get_partitions_ps_result(this); - } - - public int getSuccessSize() { - return (this.success == null) ? 0 : this.success.size(); - } - - public java.util.Iterator getSuccessIterator() { - return (this.success == null) ? null : this.success.iterator(); - } - - public void addToSuccess(Partition elem) { - if (this.success == null) { - this.success = new ArrayList(); - } - this.success.add(elem); + public drop_role_result clone() { + return new drop_role_result(this); } - public List getSuccess() { + public boolean isSuccess() { return this.success; } - public void setSuccess(List success) { + public void setSuccess(boolean success) { this.success = success; + this.__isset.success = true; } public void unsetSuccess() { - this.success = null; + this.__isset.success = false; } // Returns true if field success is set (has been asigned a value) and false otherwise public boolean isSetSuccess() { - return this.success != null; + return this.__isset.success; } public MetaException getO1() { @@ -19036,7 +31629,7 @@ if (value == null) { unsetSuccess(); } else { - setSuccess((List)value); + setSuccess((Boolean)value); } break; @@ -19056,7 +31649,7 @@ public Object getFieldValue(int fieldID) { switch (fieldID) { case SUCCESS: - return getSuccess(); + return new Boolean(isSuccess()); case O1: return getO1(); @@ -19082,21 +31675,21 @@ public boolean equals(Object that) { if (that == null) return false; - if (that instanceof get_partitions_ps_result) - return this.equals((get_partitions_ps_result)that); + if (that instanceof drop_role_result) + return this.equals((drop_role_result)that); return false; } - public boolean equals(get_partitions_ps_result that) { + public boolean equals(drop_role_result that) { if (that == null) return false; - boolean this_present_success = true && this.isSetSuccess(); - boolean that_present_success = true && that.isSetSuccess(); + boolean this_present_success = true; + boolean that_present_success = true; if (this_present_success || that_present_success) { if (!(this_present_success && that_present_success)) return false; - if (!this.success.equals(that.success)) + if (this.success != that.success) return false; } @@ -19129,19 +31722,9 @@ switch (field.id) { case SUCCESS: - if (field.type == TType.LIST) { - { - TList _list111 = iprot.readListBegin(); - this.success = new ArrayList(_list111.size); - for (int _i112 = 0; _i112 < _list111.size; ++_i112) - { - Partition _elem113; - _elem113 = new Partition(); - _elem113.read(iprot); - this.success.add(_elem113); - } - iprot.readListEnd(); - } + if (field.type == TType.BOOL) { + this.success = iprot.readBool(); + this.__isset.success = true; } else { TProtocolUtil.skip(iprot, field.type); } @@ -19170,13 +31753,7 @@ if (this.isSetSuccess()) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - { - oprot.writeListBegin(new TList(TType.STRUCT, this.success.size())); - for (Partition _iter114 : this.success) { - _iter114.write(oprot); - } - oprot.writeListEnd(); - } + oprot.writeBool(this.success); oprot.writeFieldEnd(); } else if (this.isSetO1()) { oprot.writeFieldBegin(O1_FIELD_DESC); @@ -19189,15 +31766,11 @@ @Override public String toString() { - StringBuilder sb = new StringBuilder("get_partitions_ps_result("); + StringBuilder sb = new StringBuilder("drop_role_result("); boolean first = true; sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } + sb.append(this.success); first = false; if (!first) sb.append(", "); sb.append("o1:"); @@ -19218,203 +31791,183 @@ } - public static class get_partition_names_ps_args implements TBase, java.io.Serializable, Cloneable { - private static final TStruct STRUCT_DESC = new TStruct("get_partition_names_ps_args"); - private static final TField DB_NAME_FIELD_DESC = new TField("db_name", TType.STRING, (short)1); - private static final TField TBL_NAME_FIELD_DESC = new TField("tbl_name", TType.STRING, (short)2); - private static final TField PART_VALS_FIELD_DESC = new TField("part_vals", TType.LIST, (short)3); - private static final TField MAX_PARTS_FIELD_DESC = new TField("max_parts", TType.I16, (short)4); + public static class add_role_member_args implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("add_role_member_args"); + private static final TField ROLE_NAME_FIELD_DESC = new TField("role_name", TType.STRING, (short)1); + private static final TField USER_NAME_FIELD_DESC = new TField("user_name", TType.STRING, (short)2); + private static final TField IS_ROLE_FIELD_DESC = new TField("is_role", TType.BOOL, (short)3); + private static final TField IS_GROUP_FIELD_DESC = new TField("is_group", TType.BOOL, (short)4); - private String db_name; - public static final int DB_NAME = 1; - private String tbl_name; - public static final int TBL_NAME = 2; - private List part_vals; - public static final int PART_VALS = 3; - private short max_parts; - public static final int MAX_PARTS = 4; + private String role_name; + public static final int ROLE_NAME = 1; + private String user_name; + public static final int USER_NAME = 2; + private boolean is_role; + public static final int IS_ROLE = 3; + private boolean is_group; + public static final int IS_GROUP = 4; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { - public boolean max_parts = false; + public boolean is_role = false; + public boolean is_group = false; } public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ - put(DB_NAME, new FieldMetaData("db_name", TFieldRequirementType.DEFAULT, + put(ROLE_NAME, new FieldMetaData("role_name", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRING))); - put(TBL_NAME, new FieldMetaData("tbl_name", TFieldRequirementType.DEFAULT, + put(USER_NAME, new FieldMetaData("user_name", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRING))); - put(PART_VALS, new FieldMetaData("part_vals", TFieldRequirementType.DEFAULT, - new ListMetaData(TType.LIST, - new FieldValueMetaData(TType.STRING)))); - put(MAX_PARTS, new FieldMetaData("max_parts", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.I16))); + put(IS_ROLE, new FieldMetaData("is_role", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.BOOL))); + put(IS_GROUP, new FieldMetaData("is_group", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.BOOL))); }}); static { - FieldMetaData.addStructMetaDataMap(get_partition_names_ps_args.class, metaDataMap); + FieldMetaData.addStructMetaDataMap(add_role_member_args.class, metaDataMap); } - public get_partition_names_ps_args() { - this.max_parts = (short)-1; - + public add_role_member_args() { } - public get_partition_names_ps_args( - String db_name, - String tbl_name, - List part_vals, - short max_parts) + public add_role_member_args( + String role_name, + String user_name, + boolean is_role, + boolean is_group) { this(); - this.db_name = db_name; - this.tbl_name = tbl_name; - this.part_vals = part_vals; - this.max_parts = max_parts; - this.__isset.max_parts = true; + this.role_name = role_name; + this.user_name = user_name; + this.is_role = is_role; + this.__isset.is_role = true; + this.is_group = is_group; + this.__isset.is_group = true; } /** * Performs a deep copy on other. */ - public get_partition_names_ps_args(get_partition_names_ps_args other) { - if (other.isSetDb_name()) { - this.db_name = other.db_name; - } - if (other.isSetTbl_name()) { - this.tbl_name = other.tbl_name; + public add_role_member_args(add_role_member_args other) { + if (other.isSetRole_name()) { + this.role_name = other.role_name; } - if (other.isSetPart_vals()) { - List __this__part_vals = new ArrayList(); - for (String other_element : other.part_vals) { - __this__part_vals.add(other_element); - } - this.part_vals = __this__part_vals; + if (other.isSetUser_name()) { + this.user_name = other.user_name; } - __isset.max_parts = other.__isset.max_parts; - this.max_parts = other.max_parts; + __isset.is_role = other.__isset.is_role; + this.is_role = other.is_role; + __isset.is_group = other.__isset.is_group; + this.is_group = other.is_group; } @Override - public get_partition_names_ps_args clone() { - return new get_partition_names_ps_args(this); - } - - public String getDb_name() { - return this.db_name; - } - - public void setDb_name(String db_name) { - this.db_name = db_name; - } - - public void unsetDb_name() { - this.db_name = null; + public add_role_member_args clone() { + return new add_role_member_args(this); } - // Returns true if field db_name is set (has been asigned a value) and false otherwise - public boolean isSetDb_name() { - return this.db_name != null; + public String getRole_name() { + return this.role_name; } - public String getTbl_name() { - return this.tbl_name; + public void setRole_name(String role_name) { + this.role_name = role_name; } - public void setTbl_name(String tbl_name) { - this.tbl_name = tbl_name; + public void unsetRole_name() { + this.role_name = null; } - public void unsetTbl_name() { - this.tbl_name = null; + // Returns true if field role_name is set (has been asigned a value) and false otherwise + public boolean isSetRole_name() { + return this.role_name != null; } - // Returns true if field tbl_name is set (has been asigned a value) and false otherwise - public boolean isSetTbl_name() { - return this.tbl_name != null; + public String getUser_name() { + return this.user_name; } - public int getPart_valsSize() { - return (this.part_vals == null) ? 0 : this.part_vals.size(); + public void setUser_name(String user_name) { + this.user_name = user_name; } - public java.util.Iterator getPart_valsIterator() { - return (this.part_vals == null) ? null : this.part_vals.iterator(); + public void unsetUser_name() { + this.user_name = null; } - public void addToPart_vals(String elem) { - if (this.part_vals == null) { - this.part_vals = new ArrayList(); - } - this.part_vals.add(elem); + // Returns true if field user_name is set (has been asigned a value) and false otherwise + public boolean isSetUser_name() { + return this.user_name != null; } - public List getPart_vals() { - return this.part_vals; + public boolean isIs_role() { + return this.is_role; } - public void setPart_vals(List part_vals) { - this.part_vals = part_vals; + public void setIs_role(boolean is_role) { + this.is_role = is_role; + this.__isset.is_role = true; } - public void unsetPart_vals() { - this.part_vals = null; + public void unsetIs_role() { + this.__isset.is_role = false; } - // Returns true if field part_vals is set (has been asigned a value) and false otherwise - public boolean isSetPart_vals() { - return this.part_vals != null; + // Returns true if field is_role is set (has been asigned a value) and false otherwise + public boolean isSetIs_role() { + return this.__isset.is_role; } - public short getMax_parts() { - return this.max_parts; + public boolean isIs_group() { + return this.is_group; } - public void setMax_parts(short max_parts) { - this.max_parts = max_parts; - this.__isset.max_parts = true; + public void setIs_group(boolean is_group) { + this.is_group = is_group; + this.__isset.is_group = true; } - public void unsetMax_parts() { - this.__isset.max_parts = false; + public void unsetIs_group() { + this.__isset.is_group = false; } - // Returns true if field max_parts is set (has been asigned a value) and false otherwise - public boolean isSetMax_parts() { - return this.__isset.max_parts; + // Returns true if field is_group is set (has been asigned a value) and false otherwise + public boolean isSetIs_group() { + return this.__isset.is_group; } public void setFieldValue(int fieldID, Object value) { switch (fieldID) { - case DB_NAME: + case ROLE_NAME: if (value == null) { - unsetDb_name(); + unsetRole_name(); } else { - setDb_name((String)value); + setRole_name((String)value); } break; - case TBL_NAME: + case USER_NAME: if (value == null) { - unsetTbl_name(); + unsetUser_name(); } else { - setTbl_name((String)value); + setUser_name((String)value); } break; - case PART_VALS: + case IS_ROLE: if (value == null) { - unsetPart_vals(); + unsetIs_role(); } else { - setPart_vals((List)value); + setIs_role((Boolean)value); } break; - case MAX_PARTS: + case IS_GROUP: if (value == null) { - unsetMax_parts(); + unsetIs_group(); } else { - setMax_parts((Short)value); + setIs_group((Boolean)value); } break; @@ -19425,17 +31978,17 @@ public Object getFieldValue(int fieldID) { switch (fieldID) { - case DB_NAME: - return getDb_name(); + case ROLE_NAME: + return getRole_name(); - case TBL_NAME: - return getTbl_name(); + case USER_NAME: + return getUser_name(); - case PART_VALS: - return getPart_vals(); + case IS_ROLE: + return new Boolean(isIs_role()); - case MAX_PARTS: - return new Short(getMax_parts()); + case IS_GROUP: + return new Boolean(isIs_group()); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); @@ -19445,14 +31998,14 @@ // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise public boolean isSet(int fieldID) { switch (fieldID) { - case DB_NAME: - return isSetDb_name(); - case TBL_NAME: - return isSetTbl_name(); - case PART_VALS: - return isSetPart_vals(); - case MAX_PARTS: - return isSetMax_parts(); + case ROLE_NAME: + return isSetRole_name(); + case USER_NAME: + return isSetUser_name(); + case IS_ROLE: + return isSetIs_role(); + case IS_GROUP: + return isSetIs_group(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -19462,48 +32015,48 @@ public boolean equals(Object that) { if (that == null) return false; - if (that instanceof get_partition_names_ps_args) - return this.equals((get_partition_names_ps_args)that); + if (that instanceof add_role_member_args) + return this.equals((add_role_member_args)that); return false; } - public boolean equals(get_partition_names_ps_args that) { + public boolean equals(add_role_member_args that) { if (that == null) 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) { - if (!(this_present_db_name && that_present_db_name)) + boolean this_present_role_name = true && this.isSetRole_name(); + boolean that_present_role_name = true && that.isSetRole_name(); + if (this_present_role_name || that_present_role_name) { + if (!(this_present_role_name && that_present_role_name)) return false; - if (!this.db_name.equals(that.db_name)) + if (!this.role_name.equals(that.role_name)) return false; } - boolean this_present_tbl_name = true && this.isSetTbl_name(); - boolean that_present_tbl_name = true && that.isSetTbl_name(); - if (this_present_tbl_name || that_present_tbl_name) { - if (!(this_present_tbl_name && that_present_tbl_name)) + boolean this_present_user_name = true && this.isSetUser_name(); + boolean that_present_user_name = true && that.isSetUser_name(); + if (this_present_user_name || that_present_user_name) { + if (!(this_present_user_name && that_present_user_name)) return false; - if (!this.tbl_name.equals(that.tbl_name)) + if (!this.user_name.equals(that.user_name)) return false; } - boolean this_present_part_vals = true && this.isSetPart_vals(); - boolean that_present_part_vals = true && that.isSetPart_vals(); - if (this_present_part_vals || that_present_part_vals) { - if (!(this_present_part_vals && that_present_part_vals)) + boolean this_present_is_role = true; + boolean that_present_is_role = true; + if (this_present_is_role || that_present_is_role) { + if (!(this_present_is_role && that_present_is_role)) return false; - if (!this.part_vals.equals(that.part_vals)) + if (this.is_role != that.is_role) return false; } - boolean this_present_max_parts = true; - boolean that_present_max_parts = true; - if (this_present_max_parts || that_present_max_parts) { - if (!(this_present_max_parts && that_present_max_parts)) + boolean this_present_is_group = true; + boolean that_present_is_group = true; + if (this_present_is_group || that_present_is_group) { + if (!(this_present_is_group && that_present_is_group)) return false; - if (this.max_parts != that.max_parts) + if (this.is_group != that.is_group) return false; } @@ -19526,41 +32079,32 @@ } switch (field.id) { - case DB_NAME: + case ROLE_NAME: if (field.type == TType.STRING) { - this.db_name = iprot.readString(); + this.role_name = iprot.readString(); } else { TProtocolUtil.skip(iprot, field.type); } break; - case TBL_NAME: + case USER_NAME: if (field.type == TType.STRING) { - this.tbl_name = iprot.readString(); + this.user_name = iprot.readString(); } else { TProtocolUtil.skip(iprot, field.type); } break; - case PART_VALS: - if (field.type == TType.LIST) { - { - TList _list115 = iprot.readListBegin(); - this.part_vals = new ArrayList(_list115.size); - for (int _i116 = 0; _i116 < _list115.size; ++_i116) - { - String _elem117; - _elem117 = iprot.readString(); - this.part_vals.add(_elem117); - } - iprot.readListEnd(); - } + case IS_ROLE: + if (field.type == TType.BOOL) { + this.is_role = iprot.readBool(); + this.__isset.is_role = true; } else { TProtocolUtil.skip(iprot, field.type); } break; - case MAX_PARTS: - if (field.type == TType.I16) { - this.max_parts = iprot.readI16(); - this.__isset.max_parts = true; + case IS_GROUP: + if (field.type == TType.BOOL) { + this.is_group = iprot.readBool(); + this.__isset.is_group = true; } else { TProtocolUtil.skip(iprot, field.type); } @@ -19580,29 +32124,21 @@ validate(); oprot.writeStructBegin(STRUCT_DESC); - if (this.db_name != null) { - oprot.writeFieldBegin(DB_NAME_FIELD_DESC); - oprot.writeString(this.db_name); - oprot.writeFieldEnd(); - } - if (this.tbl_name != null) { - oprot.writeFieldBegin(TBL_NAME_FIELD_DESC); - oprot.writeString(this.tbl_name); + if (this.role_name != null) { + oprot.writeFieldBegin(ROLE_NAME_FIELD_DESC); + oprot.writeString(this.role_name); oprot.writeFieldEnd(); } - if (this.part_vals != null) { - oprot.writeFieldBegin(PART_VALS_FIELD_DESC); - { - oprot.writeListBegin(new TList(TType.STRING, this.part_vals.size())); - for (String _iter118 : this.part_vals) { - oprot.writeString(_iter118); - } - oprot.writeListEnd(); - } + if (this.user_name != null) { + oprot.writeFieldBegin(USER_NAME_FIELD_DESC); + oprot.writeString(this.user_name); oprot.writeFieldEnd(); } - oprot.writeFieldBegin(MAX_PARTS_FIELD_DESC); - oprot.writeI16(this.max_parts); + oprot.writeFieldBegin(IS_ROLE_FIELD_DESC); + oprot.writeBool(this.is_role); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(IS_GROUP_FIELD_DESC); + oprot.writeBool(this.is_group); oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); @@ -19610,35 +32146,31 @@ @Override public String toString() { - StringBuilder sb = new StringBuilder("get_partition_names_ps_args("); + StringBuilder sb = new StringBuilder("add_role_member_args("); boolean first = true; - sb.append("db_name:"); - if (this.db_name == null) { + sb.append("role_name:"); + if (this.role_name == null) { sb.append("null"); } else { - sb.append(this.db_name); + sb.append(this.role_name); } first = false; if (!first) sb.append(", "); - sb.append("tbl_name:"); - if (this.tbl_name == null) { + sb.append("user_name:"); + if (this.user_name == null) { sb.append("null"); } else { - sb.append(this.tbl_name); + sb.append(this.user_name); } first = false; if (!first) sb.append(", "); - sb.append("part_vals:"); - if (this.part_vals == null) { - sb.append("null"); - } else { - sb.append(this.part_vals); - } + sb.append("is_role:"); + sb.append(this.is_role); first = false; if (!first) sb.append(", "); - sb.append("max_parts:"); - sb.append(this.max_parts); + sb.append("is_group:"); + sb.append(this.is_group); first = false; sb.append(")"); return sb.toString(); @@ -19651,95 +32183,77 @@ } - public static class get_partition_names_ps_result implements TBase, java.io.Serializable, Cloneable { - private static final TStruct STRUCT_DESC = new TStruct("get_partition_names_ps_result"); - private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.LIST, (short)0); + public static class add_role_member_result implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("add_role_member_result"); + private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.BOOL, (short)0); private static final TField O1_FIELD_DESC = new TField("o1", TType.STRUCT, (short)1); - private List success; + private boolean success; public static final int SUCCESS = 0; private MetaException o1; public static final int O1 = 1; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { + public boolean success = false; } public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ put(SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, - new ListMetaData(TType.LIST, - new FieldValueMetaData(TType.STRING)))); + new FieldValueMetaData(TType.BOOL))); put(O1, new FieldMetaData("o1", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRUCT))); }}); static { - FieldMetaData.addStructMetaDataMap(get_partition_names_ps_result.class, metaDataMap); + FieldMetaData.addStructMetaDataMap(add_role_member_result.class, metaDataMap); } - public get_partition_names_ps_result() { + public add_role_member_result() { } - public get_partition_names_ps_result( - List success, + public add_role_member_result( + boolean success, MetaException o1) { this(); this.success = success; + this.__isset.success = true; this.o1 = o1; } /** * Performs a deep copy on other. */ - public get_partition_names_ps_result(get_partition_names_ps_result other) { - if (other.isSetSuccess()) { - List __this__success = new ArrayList(); - for (String other_element : other.success) { - __this__success.add(other_element); - } - this.success = __this__success; - } + public add_role_member_result(add_role_member_result other) { + __isset.success = other.__isset.success; + this.success = other.success; if (other.isSetO1()) { this.o1 = new MetaException(other.o1); } } @Override - public get_partition_names_ps_result clone() { - return new get_partition_names_ps_result(this); - } - - public int getSuccessSize() { - return (this.success == null) ? 0 : this.success.size(); - } - - public java.util.Iterator getSuccessIterator() { - return (this.success == null) ? null : this.success.iterator(); - } - - public void addToSuccess(String elem) { - if (this.success == null) { - this.success = new ArrayList(); - } - this.success.add(elem); + public add_role_member_result clone() { + return new add_role_member_result(this); } - public List getSuccess() { + public boolean isSuccess() { return this.success; } - public void setSuccess(List success) { + public void setSuccess(boolean success) { this.success = success; + this.__isset.success = true; } public void unsetSuccess() { - this.success = null; + this.__isset.success = false; } // Returns true if field success is set (has been asigned a value) and false otherwise public boolean isSetSuccess() { - return this.success != null; + return this.__isset.success; } public MetaException getO1() { @@ -19765,7 +32279,7 @@ if (value == null) { unsetSuccess(); } else { - setSuccess((List)value); + setSuccess((Boolean)value); } break; @@ -19785,7 +32299,7 @@ public Object getFieldValue(int fieldID) { switch (fieldID) { case SUCCESS: - return getSuccess(); + return new Boolean(isSuccess()); case O1: return getO1(); @@ -19811,21 +32325,21 @@ public boolean equals(Object that) { if (that == null) return false; - if (that instanceof get_partition_names_ps_result) - return this.equals((get_partition_names_ps_result)that); + if (that instanceof add_role_member_result) + return this.equals((add_role_member_result)that); return false; } - public boolean equals(get_partition_names_ps_result that) { + public boolean equals(add_role_member_result that) { if (that == null) return false; - boolean this_present_success = true && this.isSetSuccess(); - boolean that_present_success = true && that.isSetSuccess(); + boolean this_present_success = true; + boolean that_present_success = true; if (this_present_success || that_present_success) { if (!(this_present_success && that_present_success)) return false; - if (!this.success.equals(that.success)) + if (this.success != that.success) return false; } @@ -19858,18 +32372,9 @@ switch (field.id) { case SUCCESS: - if (field.type == TType.LIST) { - { - TList _list119 = iprot.readListBegin(); - this.success = new ArrayList(_list119.size); - for (int _i120 = 0; _i120 < _list119.size; ++_i120) - { - String _elem121; - _elem121 = iprot.readString(); - this.success.add(_elem121); - } - iprot.readListEnd(); - } + if (field.type == TType.BOOL) { + this.success = iprot.readBool(); + this.__isset.success = true; } else { TProtocolUtil.skip(iprot, field.type); } @@ -19898,13 +32403,7 @@ if (this.isSetSuccess()) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - { - oprot.writeListBegin(new TList(TType.STRING, this.success.size())); - for (String _iter122 : this.success) { - oprot.writeString(_iter122); - } - oprot.writeListEnd(); - } + oprot.writeBool(this.success); oprot.writeFieldEnd(); } else if (this.isSetO1()) { oprot.writeFieldBegin(O1_FIELD_DESC); @@ -19917,15 +32416,11 @@ @Override public String toString() { - StringBuilder sb = new StringBuilder("get_partition_names_ps_result("); + StringBuilder sb = new StringBuilder("add_role_member_result("); boolean first = true; sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } + sb.append(this.success); first = false; if (!first) sb.append(", "); sb.append("o1:"); @@ -19946,183 +32441,183 @@ } - public static class get_partitions_by_filter_args implements TBase, java.io.Serializable, Cloneable { - private static final TStruct STRUCT_DESC = new TStruct("get_partitions_by_filter_args"); - private static final TField DB_NAME_FIELD_DESC = new TField("db_name", TType.STRING, (short)1); - private static final TField TBL_NAME_FIELD_DESC = new TField("tbl_name", TType.STRING, (short)2); - private static final TField FILTER_FIELD_DESC = new TField("filter", TType.STRING, (short)3); - private static final TField MAX_PARTS_FIELD_DESC = new TField("max_parts", TType.I16, (short)4); + public static class remove_role_member_args implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("remove_role_member_args"); + private static final TField ROLE_NAME_FIELD_DESC = new TField("role_name", TType.STRING, (short)1); + private static final TField USER_NAME_FIELD_DESC = new TField("user_name", TType.STRING, (short)2); + private static final TField IS_ROLE_FIELD_DESC = new TField("is_role", TType.BOOL, (short)3); + private static final TField IS_GROUP_FIELD_DESC = new TField("is_group", TType.BOOL, (short)4); - private String db_name; - public static final int DB_NAME = 1; - private String tbl_name; - public static final int TBL_NAME = 2; - private String filter; - public static final int FILTER = 3; - private short max_parts; - public static final int MAX_PARTS = 4; + private String role_name; + public static final int ROLE_NAME = 1; + private String user_name; + public static final int USER_NAME = 2; + private boolean is_role; + public static final int IS_ROLE = 3; + private boolean is_group; + public static final int IS_GROUP = 4; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { - public boolean max_parts = false; + public boolean is_role = false; + public boolean is_group = false; } public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ - put(DB_NAME, new FieldMetaData("db_name", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRING))); - put(TBL_NAME, new FieldMetaData("tbl_name", TFieldRequirementType.DEFAULT, + put(ROLE_NAME, new FieldMetaData("role_name", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRING))); - put(FILTER, new FieldMetaData("filter", TFieldRequirementType.DEFAULT, + put(USER_NAME, new FieldMetaData("user_name", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRING))); - put(MAX_PARTS, new FieldMetaData("max_parts", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.I16))); + put(IS_ROLE, new FieldMetaData("is_role", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.BOOL))); + put(IS_GROUP, new FieldMetaData("is_group", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.BOOL))); }}); static { - FieldMetaData.addStructMetaDataMap(get_partitions_by_filter_args.class, metaDataMap); + FieldMetaData.addStructMetaDataMap(remove_role_member_args.class, metaDataMap); } - public get_partitions_by_filter_args() { - this.max_parts = (short)-1; - + public remove_role_member_args() { } - public get_partitions_by_filter_args( - String db_name, - String tbl_name, - String filter, - short max_parts) + public remove_role_member_args( + String role_name, + String user_name, + boolean is_role, + boolean is_group) { this(); - this.db_name = db_name; - this.tbl_name = tbl_name; - this.filter = filter; - this.max_parts = max_parts; - this.__isset.max_parts = true; + this.role_name = role_name; + this.user_name = user_name; + this.is_role = is_role; + this.__isset.is_role = true; + this.is_group = is_group; + this.__isset.is_group = true; } /** * Performs a deep copy on other. */ - public get_partitions_by_filter_args(get_partitions_by_filter_args other) { - if (other.isSetDb_name()) { - this.db_name = other.db_name; - } - if (other.isSetTbl_name()) { - this.tbl_name = other.tbl_name; + public remove_role_member_args(remove_role_member_args other) { + if (other.isSetRole_name()) { + this.role_name = other.role_name; } - if (other.isSetFilter()) { - this.filter = other.filter; + if (other.isSetUser_name()) { + this.user_name = other.user_name; } - __isset.max_parts = other.__isset.max_parts; - this.max_parts = other.max_parts; + __isset.is_role = other.__isset.is_role; + this.is_role = other.is_role; + __isset.is_group = other.__isset.is_group; + this.is_group = other.is_group; } @Override - public get_partitions_by_filter_args clone() { - return new get_partitions_by_filter_args(this); + public remove_role_member_args clone() { + return new remove_role_member_args(this); } - public String getDb_name() { - return this.db_name; + public String getRole_name() { + return this.role_name; } - public void setDb_name(String db_name) { - this.db_name = db_name; + public void setRole_name(String role_name) { + this.role_name = role_name; } - public void unsetDb_name() { - this.db_name = null; + public void unsetRole_name() { + this.role_name = null; } - // Returns true if field db_name is set (has been asigned a value) and false otherwise - public boolean isSetDb_name() { - return this.db_name != null; + // Returns true if field role_name is set (has been asigned a value) and false otherwise + public boolean isSetRole_name() { + return this.role_name != null; } - public String getTbl_name() { - return this.tbl_name; + public String getUser_name() { + return this.user_name; } - public void setTbl_name(String tbl_name) { - this.tbl_name = tbl_name; + public void setUser_name(String user_name) { + this.user_name = user_name; } - public void unsetTbl_name() { - this.tbl_name = null; + public void unsetUser_name() { + this.user_name = null; } - // Returns true if field tbl_name is set (has been asigned a value) and false otherwise - public boolean isSetTbl_name() { - return this.tbl_name != null; + // Returns true if field user_name is set (has been asigned a value) and false otherwise + public boolean isSetUser_name() { + return this.user_name != null; } - public String getFilter() { - return this.filter; + public boolean isIs_role() { + return this.is_role; } - public void setFilter(String filter) { - this.filter = filter; + public void setIs_role(boolean is_role) { + this.is_role = is_role; + this.__isset.is_role = true; } - public void unsetFilter() { - this.filter = null; + public void unsetIs_role() { + this.__isset.is_role = false; } - // Returns true if field filter is set (has been asigned a value) and false otherwise - public boolean isSetFilter() { - return this.filter != null; + // Returns true if field is_role is set (has been asigned a value) and false otherwise + public boolean isSetIs_role() { + return this.__isset.is_role; } - public short getMax_parts() { - return this.max_parts; + public boolean isIs_group() { + return this.is_group; } - public void setMax_parts(short max_parts) { - this.max_parts = max_parts; - this.__isset.max_parts = true; + public void setIs_group(boolean is_group) { + this.is_group = is_group; + this.__isset.is_group = true; } - public void unsetMax_parts() { - this.__isset.max_parts = false; + public void unsetIs_group() { + this.__isset.is_group = false; } - // Returns true if field max_parts is set (has been asigned a value) and false otherwise - public boolean isSetMax_parts() { - return this.__isset.max_parts; + // Returns true if field is_group is set (has been asigned a value) and false otherwise + public boolean isSetIs_group() { + return this.__isset.is_group; } public void setFieldValue(int fieldID, Object value) { switch (fieldID) { - case DB_NAME: + case ROLE_NAME: if (value == null) { - unsetDb_name(); + unsetRole_name(); } else { - setDb_name((String)value); + setRole_name((String)value); } break; - case TBL_NAME: + case USER_NAME: if (value == null) { - unsetTbl_name(); + unsetUser_name(); } else { - setTbl_name((String)value); + setUser_name((String)value); } break; - case FILTER: + case IS_ROLE: if (value == null) { - unsetFilter(); + unsetIs_role(); } else { - setFilter((String)value); + setIs_role((Boolean)value); } break; - case MAX_PARTS: + case IS_GROUP: if (value == null) { - unsetMax_parts(); + unsetIs_group(); } else { - setMax_parts((Short)value); + setIs_group((Boolean)value); } break; @@ -20133,17 +32628,17 @@ public Object getFieldValue(int fieldID) { switch (fieldID) { - case DB_NAME: - return getDb_name(); + case ROLE_NAME: + return getRole_name(); - case TBL_NAME: - return getTbl_name(); + case USER_NAME: + return getUser_name(); - case FILTER: - return getFilter(); + case IS_ROLE: + return new Boolean(isIs_role()); - case MAX_PARTS: - return new Short(getMax_parts()); + case IS_GROUP: + return new Boolean(isIs_group()); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); @@ -20153,14 +32648,14 @@ // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise public boolean isSet(int fieldID) { switch (fieldID) { - case DB_NAME: - return isSetDb_name(); - case TBL_NAME: - return isSetTbl_name(); - case FILTER: - return isSetFilter(); - case MAX_PARTS: - return isSetMax_parts(); + case ROLE_NAME: + return isSetRole_name(); + case USER_NAME: + return isSetUser_name(); + case IS_ROLE: + return isSetIs_role(); + case IS_GROUP: + return isSetIs_group(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -20170,48 +32665,48 @@ public boolean equals(Object that) { if (that == null) return false; - if (that instanceof get_partitions_by_filter_args) - return this.equals((get_partitions_by_filter_args)that); + if (that instanceof remove_role_member_args) + return this.equals((remove_role_member_args)that); return false; } - public boolean equals(get_partitions_by_filter_args that) { + public boolean equals(remove_role_member_args that) { if (that == null) 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) { - if (!(this_present_db_name && that_present_db_name)) + boolean this_present_role_name = true && this.isSetRole_name(); + boolean that_present_role_name = true && that.isSetRole_name(); + if (this_present_role_name || that_present_role_name) { + if (!(this_present_role_name && that_present_role_name)) return false; - if (!this.db_name.equals(that.db_name)) + if (!this.role_name.equals(that.role_name)) return false; } - boolean this_present_tbl_name = true && this.isSetTbl_name(); - boolean that_present_tbl_name = true && that.isSetTbl_name(); - if (this_present_tbl_name || that_present_tbl_name) { - if (!(this_present_tbl_name && that_present_tbl_name)) + boolean this_present_user_name = true && this.isSetUser_name(); + boolean that_present_user_name = true && that.isSetUser_name(); + if (this_present_user_name || that_present_user_name) { + if (!(this_present_user_name && that_present_user_name)) return false; - if (!this.tbl_name.equals(that.tbl_name)) + if (!this.user_name.equals(that.user_name)) return false; } - boolean this_present_filter = true && this.isSetFilter(); - boolean that_present_filter = true && that.isSetFilter(); - if (this_present_filter || that_present_filter) { - if (!(this_present_filter && that_present_filter)) + boolean this_present_is_role = true; + boolean that_present_is_role = true; + if (this_present_is_role || that_present_is_role) { + if (!(this_present_is_role && that_present_is_role)) return false; - if (!this.filter.equals(that.filter)) + if (this.is_role != that.is_role) return false; } - boolean this_present_max_parts = true; - boolean that_present_max_parts = true; - if (this_present_max_parts || that_present_max_parts) { - if (!(this_present_max_parts && that_present_max_parts)) + boolean this_present_is_group = true; + boolean that_present_is_group = true; + if (this_present_is_group || that_present_is_group) { + if (!(this_present_is_group && that_present_is_group)) return false; - if (this.max_parts != that.max_parts) + if (this.is_group != that.is_group) return false; } @@ -20234,31 +32729,32 @@ } switch (field.id) { - case DB_NAME: + case ROLE_NAME: if (field.type == TType.STRING) { - this.db_name = iprot.readString(); + this.role_name = iprot.readString(); } else { TProtocolUtil.skip(iprot, field.type); } break; - case TBL_NAME: + case USER_NAME: if (field.type == TType.STRING) { - this.tbl_name = iprot.readString(); + this.user_name = iprot.readString(); } else { TProtocolUtil.skip(iprot, field.type); } break; - case FILTER: - if (field.type == TType.STRING) { - this.filter = iprot.readString(); + case IS_ROLE: + if (field.type == TType.BOOL) { + this.is_role = iprot.readBool(); + this.__isset.is_role = true; } else { TProtocolUtil.skip(iprot, field.type); } break; - case MAX_PARTS: - if (field.type == TType.I16) { - this.max_parts = iprot.readI16(); - this.__isset.max_parts = true; + case IS_GROUP: + if (field.type == TType.BOOL) { + this.is_group = iprot.readBool(); + this.__isset.is_group = true; } else { TProtocolUtil.skip(iprot, field.type); } @@ -20278,23 +32774,21 @@ validate(); oprot.writeStructBegin(STRUCT_DESC); - if (this.db_name != null) { - oprot.writeFieldBegin(DB_NAME_FIELD_DESC); - oprot.writeString(this.db_name); - oprot.writeFieldEnd(); - } - if (this.tbl_name != null) { - oprot.writeFieldBegin(TBL_NAME_FIELD_DESC); - oprot.writeString(this.tbl_name); + if (this.role_name != null) { + oprot.writeFieldBegin(ROLE_NAME_FIELD_DESC); + oprot.writeString(this.role_name); oprot.writeFieldEnd(); } - if (this.filter != null) { - oprot.writeFieldBegin(FILTER_FIELD_DESC); - oprot.writeString(this.filter); + if (this.user_name != null) { + oprot.writeFieldBegin(USER_NAME_FIELD_DESC); + oprot.writeString(this.user_name); oprot.writeFieldEnd(); } - oprot.writeFieldBegin(MAX_PARTS_FIELD_DESC); - oprot.writeI16(this.max_parts); + oprot.writeFieldBegin(IS_ROLE_FIELD_DESC); + oprot.writeBool(this.is_role); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(IS_GROUP_FIELD_DESC); + oprot.writeBool(this.is_group); oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); @@ -20302,35 +32796,31 @@ @Override public String toString() { - StringBuilder sb = new StringBuilder("get_partitions_by_filter_args("); + StringBuilder sb = new StringBuilder("remove_role_member_args("); boolean first = true; - sb.append("db_name:"); - if (this.db_name == null) { - sb.append("null"); - } else { - sb.append(this.db_name); - } - first = false; - if (!first) sb.append(", "); - sb.append("tbl_name:"); - if (this.tbl_name == null) { + sb.append("role_name:"); + if (this.role_name == null) { sb.append("null"); } else { - sb.append(this.tbl_name); + sb.append(this.role_name); } first = false; if (!first) sb.append(", "); - sb.append("filter:"); - if (this.filter == null) { + sb.append("user_name:"); + if (this.user_name == null) { sb.append("null"); } else { - sb.append(this.filter); + sb.append(this.user_name); } first = false; if (!first) sb.append(", "); - sb.append("max_parts:"); - sb.append(this.max_parts); + sb.append("is_role:"); + sb.append(this.is_role); + first = false; + if (!first) sb.append(", "); + sb.append("is_group:"); + sb.append(this.is_group); first = false; sb.append(")"); return sb.toString(); @@ -20343,105 +32833,77 @@ } - public static class get_partitions_by_filter_result implements TBase, java.io.Serializable, Cloneable { - private static final TStruct STRUCT_DESC = new TStruct("get_partitions_by_filter_result"); - private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.LIST, (short)0); + public static class remove_role_member_result implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("remove_role_member_result"); + private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.BOOL, (short)0); private static final TField O1_FIELD_DESC = new TField("o1", TType.STRUCT, (short)1); - private static final TField O2_FIELD_DESC = new TField("o2", TType.STRUCT, (short)2); - private List success; + private boolean success; public static final int SUCCESS = 0; private MetaException o1; public static final int O1 = 1; - private NoSuchObjectException o2; - public static final int O2 = 2; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { + public boolean success = false; } public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ put(SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, - new ListMetaData(TType.LIST, - new StructMetaData(TType.STRUCT, Partition.class)))); + new FieldValueMetaData(TType.BOOL))); put(O1, new FieldMetaData("o1", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRUCT))); - put(O2, new FieldMetaData("o2", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRUCT))); }}); static { - FieldMetaData.addStructMetaDataMap(get_partitions_by_filter_result.class, metaDataMap); + FieldMetaData.addStructMetaDataMap(remove_role_member_result.class, metaDataMap); } - public get_partitions_by_filter_result() { + public remove_role_member_result() { } - public get_partitions_by_filter_result( - List success, - MetaException o1, - NoSuchObjectException o2) + public remove_role_member_result( + boolean success, + MetaException o1) { this(); this.success = success; + this.__isset.success = true; this.o1 = o1; - this.o2 = o2; } /** * Performs a deep copy on other. */ - public get_partitions_by_filter_result(get_partitions_by_filter_result other) { - if (other.isSetSuccess()) { - List __this__success = new ArrayList(); - for (Partition other_element : other.success) { - __this__success.add(new Partition(other_element)); - } - this.success = __this__success; - } + public remove_role_member_result(remove_role_member_result other) { + __isset.success = other.__isset.success; + this.success = other.success; if (other.isSetO1()) { this.o1 = new MetaException(other.o1); } - if (other.isSetO2()) { - this.o2 = new NoSuchObjectException(other.o2); - } } @Override - public get_partitions_by_filter_result clone() { - return new get_partitions_by_filter_result(this); - } - - public int getSuccessSize() { - return (this.success == null) ? 0 : this.success.size(); - } - - public java.util.Iterator getSuccessIterator() { - return (this.success == null) ? null : this.success.iterator(); - } - - public void addToSuccess(Partition elem) { - if (this.success == null) { - this.success = new ArrayList(); - } - this.success.add(elem); + public remove_role_member_result clone() { + return new remove_role_member_result(this); } - public List getSuccess() { + public boolean isSuccess() { return this.success; } - public void setSuccess(List success) { + public void setSuccess(boolean success) { this.success = success; + this.__isset.success = true; } public void unsetSuccess() { - this.success = null; + this.__isset.success = false; } // Returns true if field success is set (has been asigned a value) and false otherwise public boolean isSetSuccess() { - return this.success != null; + return this.__isset.success; } public MetaException getO1() { @@ -20461,30 +32923,13 @@ return this.o1 != null; } - public NoSuchObjectException getO2() { - return this.o2; - } - - public void setO2(NoSuchObjectException o2) { - this.o2 = o2; - } - - public void unsetO2() { - this.o2 = null; - } - - // Returns true if field o2 is set (has been asigned a value) and false otherwise - public boolean isSetO2() { - return this.o2 != null; - } - public void setFieldValue(int fieldID, Object value) { switch (fieldID) { case SUCCESS: if (value == null) { unsetSuccess(); } else { - setSuccess((List)value); + setSuccess((Boolean)value); } break; @@ -20496,14 +32941,6 @@ } break; - case O2: - if (value == null) { - unsetO2(); - } else { - setO2((NoSuchObjectException)value); - } - break; - default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -20512,14 +32949,11 @@ public Object getFieldValue(int fieldID) { switch (fieldID) { case SUCCESS: - return getSuccess(); + return new Boolean(isSuccess()); case O1: return getO1(); - case O2: - return getO2(); - default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -20532,8 +32966,6 @@ return isSetSuccess(); case O1: return isSetO1(); - case O2: - return isSetO2(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -20543,21 +32975,21 @@ public boolean equals(Object that) { if (that == null) return false; - if (that instanceof get_partitions_by_filter_result) - return this.equals((get_partitions_by_filter_result)that); + if (that instanceof remove_role_member_result) + return this.equals((remove_role_member_result)that); return false; } - public boolean equals(get_partitions_by_filter_result that) { + public boolean equals(remove_role_member_result that) { if (that == null) return false; - boolean this_present_success = true && this.isSetSuccess(); - boolean that_present_success = true && that.isSetSuccess(); + boolean this_present_success = true; + boolean that_present_success = true; if (this_present_success || that_present_success) { if (!(this_present_success && that_present_success)) return false; - if (!this.success.equals(that.success)) + if (this.success != that.success) return false; } @@ -20570,15 +33002,6 @@ return false; } - boolean this_present_o2 = true && this.isSetO2(); - boolean that_present_o2 = true && that.isSetO2(); - if (this_present_o2 || that_present_o2) { - if (!(this_present_o2 && that_present_o2)) - return false; - if (!this.o2.equals(that.o2)) - return false; - } - return true; } @@ -20599,19 +33022,9 @@ switch (field.id) { case SUCCESS: - if (field.type == TType.LIST) { - { - TList _list123 = iprot.readListBegin(); - this.success = new ArrayList(_list123.size); - for (int _i124 = 0; _i124 < _list123.size; ++_i124) - { - Partition _elem125; - _elem125 = new Partition(); - _elem125.read(iprot); - this.success.add(_elem125); - } - iprot.readListEnd(); - } + if (field.type == TType.BOOL) { + this.success = iprot.readBool(); + this.__isset.success = true; } else { TProtocolUtil.skip(iprot, field.type); } @@ -20624,14 +33037,6 @@ TProtocolUtil.skip(iprot, field.type); } break; - case O2: - if (field.type == TType.STRUCT) { - this.o2 = new NoSuchObjectException(); - this.o2.read(iprot); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; default: TProtocolUtil.skip(iprot, field.type); break; @@ -20648,22 +33053,12 @@ if (this.isSetSuccess()) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - { - oprot.writeListBegin(new TList(TType.STRUCT, this.success.size())); - for (Partition _iter126 : this.success) { - _iter126.write(oprot); - } - oprot.writeListEnd(); - } + oprot.writeBool(this.success); oprot.writeFieldEnd(); } else if (this.isSetO1()) { oprot.writeFieldBegin(O1_FIELD_DESC); this.o1.write(oprot); oprot.writeFieldEnd(); - } else if (this.isSetO2()) { - oprot.writeFieldBegin(O2_FIELD_DESC); - this.o2.write(oprot); - oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); @@ -20671,15 +33066,11 @@ @Override public String toString() { - StringBuilder sb = new StringBuilder("get_partitions_by_filter_result("); + StringBuilder sb = new StringBuilder("remove_role_member_result("); boolean first = true; sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } + sb.append(this.success); first = false; if (!first) sb.append(", "); sb.append("o1:"); @@ -20689,14 +33080,6 @@ sb.append(this.o1); } first = false; - if (!first) sb.append(", "); - sb.append("o2:"); - if (this.o2 == null) { - sb.append("null"); - } else { - sb.append(this.o2); - } - first = false; sb.append(")"); return sb.toString(); } @@ -20708,144 +33091,148 @@ } - public static class alter_partition_args implements TBase, java.io.Serializable, Cloneable { - private static final TStruct STRUCT_DESC = new TStruct("alter_partition_args"); - private static final TField DB_NAME_FIELD_DESC = new TField("db_name", TType.STRING, (short)1); - private static final TField TBL_NAME_FIELD_DESC = new TField("tbl_name", TType.STRING, (short)2); - private static final TField NEW_PART_FIELD_DESC = new TField("new_part", TType.STRUCT, (short)3); + public static class list_security_user_grant_args implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("list_security_user_grant_args"); + private static final TField PRINCIPLA_NAME_FIELD_DESC = new TField("principla_name", TType.STRING, (short)1); + private static final TField IS_ROLE_FIELD_DESC = new TField("is_role", TType.BOOL, (short)2); + private static final TField IS_GROUP_FIELD_DESC = new TField("is_group", TType.BOOL, (short)3); - private String db_name; - public static final int DB_NAME = 1; - private String tbl_name; - public static final int TBL_NAME = 2; - private Partition new_part; - public static final int NEW_PART = 3; + private String principla_name; + public static final int PRINCIPLA_NAME = 1; + private boolean is_role; + public static final int IS_ROLE = 2; + private boolean is_group; + public static final int IS_GROUP = 3; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { + public boolean is_role = false; + public boolean is_group = false; } public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ - put(DB_NAME, new FieldMetaData("db_name", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRING))); - put(TBL_NAME, new FieldMetaData("tbl_name", TFieldRequirementType.DEFAULT, + put(PRINCIPLA_NAME, new FieldMetaData("principla_name", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRING))); - put(NEW_PART, new FieldMetaData("new_part", TFieldRequirementType.DEFAULT, - new StructMetaData(TType.STRUCT, Partition.class))); + put(IS_ROLE, new FieldMetaData("is_role", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.BOOL))); + put(IS_GROUP, new FieldMetaData("is_group", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.BOOL))); }}); static { - FieldMetaData.addStructMetaDataMap(alter_partition_args.class, metaDataMap); + FieldMetaData.addStructMetaDataMap(list_security_user_grant_args.class, metaDataMap); } - public alter_partition_args() { + public list_security_user_grant_args() { } - public alter_partition_args( - String db_name, - String tbl_name, - Partition new_part) + public list_security_user_grant_args( + String principla_name, + boolean is_role, + boolean is_group) { this(); - this.db_name = db_name; - this.tbl_name = tbl_name; - this.new_part = new_part; + this.principla_name = principla_name; + this.is_role = is_role; + this.__isset.is_role = true; + this.is_group = is_group; + this.__isset.is_group = true; } /** * Performs a deep copy on other. */ - public alter_partition_args(alter_partition_args other) { - if (other.isSetDb_name()) { - this.db_name = other.db_name; - } - if (other.isSetTbl_name()) { - this.tbl_name = other.tbl_name; - } - if (other.isSetNew_part()) { - this.new_part = new Partition(other.new_part); + public list_security_user_grant_args(list_security_user_grant_args other) { + if (other.isSetPrincipla_name()) { + this.principla_name = other.principla_name; } + __isset.is_role = other.__isset.is_role; + this.is_role = other.is_role; + __isset.is_group = other.__isset.is_group; + this.is_group = other.is_group; } @Override - public alter_partition_args clone() { - return new alter_partition_args(this); + public list_security_user_grant_args clone() { + return new list_security_user_grant_args(this); } - public String getDb_name() { - return this.db_name; + public String getPrincipla_name() { + return this.principla_name; } - public void setDb_name(String db_name) { - this.db_name = db_name; + public void setPrincipla_name(String principla_name) { + this.principla_name = principla_name; } - public void unsetDb_name() { - this.db_name = null; + public void unsetPrincipla_name() { + this.principla_name = null; } - // Returns true if field db_name is set (has been asigned a value) and false otherwise - public boolean isSetDb_name() { - return this.db_name != null; + // Returns true if field principla_name is set (has been asigned a value) and false otherwise + public boolean isSetPrincipla_name() { + return this.principla_name != null; } - public String getTbl_name() { - return this.tbl_name; + public boolean isIs_role() { + return this.is_role; } - public void setTbl_name(String tbl_name) { - this.tbl_name = tbl_name; + public void setIs_role(boolean is_role) { + this.is_role = is_role; + this.__isset.is_role = true; } - public void unsetTbl_name() { - this.tbl_name = null; + public void unsetIs_role() { + this.__isset.is_role = false; } - // Returns true if field tbl_name is set (has been asigned a value) and false otherwise - public boolean isSetTbl_name() { - return this.tbl_name != null; + // Returns true if field is_role is set (has been asigned a value) and false otherwise + public boolean isSetIs_role() { + return this.__isset.is_role; } - public Partition getNew_part() { - return this.new_part; + public boolean isIs_group() { + return this.is_group; } - public void setNew_part(Partition new_part) { - this.new_part = new_part; + public void setIs_group(boolean is_group) { + this.is_group = is_group; + this.__isset.is_group = true; } - public void unsetNew_part() { - this.new_part = null; + public void unsetIs_group() { + this.__isset.is_group = false; } - // Returns true if field new_part is set (has been asigned a value) and false otherwise - public boolean isSetNew_part() { - return this.new_part != null; + // Returns true if field is_group is set (has been asigned a value) and false otherwise + public boolean isSetIs_group() { + return this.__isset.is_group; } public void setFieldValue(int fieldID, Object value) { switch (fieldID) { - case DB_NAME: + case PRINCIPLA_NAME: if (value == null) { - unsetDb_name(); + unsetPrincipla_name(); } else { - setDb_name((String)value); + setPrincipla_name((String)value); } break; - case TBL_NAME: + case IS_ROLE: if (value == null) { - unsetTbl_name(); + unsetIs_role(); } else { - setTbl_name((String)value); + setIs_role((Boolean)value); } break; - case NEW_PART: + case IS_GROUP: if (value == null) { - unsetNew_part(); + unsetIs_group(); } else { - setNew_part((Partition)value); + setIs_group((Boolean)value); } break; @@ -20856,14 +33243,14 @@ public Object getFieldValue(int fieldID) { switch (fieldID) { - case DB_NAME: - return getDb_name(); + case PRINCIPLA_NAME: + return getPrincipla_name(); - case TBL_NAME: - return getTbl_name(); + case IS_ROLE: + return new Boolean(isIs_role()); - case NEW_PART: - return getNew_part(); + case IS_GROUP: + return new Boolean(isIs_group()); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); @@ -20873,12 +33260,12 @@ // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise public boolean isSet(int fieldID) { switch (fieldID) { - case DB_NAME: - return isSetDb_name(); - case TBL_NAME: - return isSetTbl_name(); - case NEW_PART: - return isSetNew_part(); + case PRINCIPLA_NAME: + return isSetPrincipla_name(); + case IS_ROLE: + return isSetIs_role(); + case IS_GROUP: + return isSetIs_group(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -20888,39 +33275,39 @@ public boolean equals(Object that) { if (that == null) return false; - if (that instanceof alter_partition_args) - return this.equals((alter_partition_args)that); + if (that instanceof list_security_user_grant_args) + return this.equals((list_security_user_grant_args)that); return false; } - public boolean equals(alter_partition_args that) { + public boolean equals(list_security_user_grant_args that) { if (that == null) 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) { - if (!(this_present_db_name && that_present_db_name)) + boolean this_present_principla_name = true && this.isSetPrincipla_name(); + boolean that_present_principla_name = true && that.isSetPrincipla_name(); + if (this_present_principla_name || that_present_principla_name) { + if (!(this_present_principla_name && that_present_principla_name)) return false; - if (!this.db_name.equals(that.db_name)) + if (!this.principla_name.equals(that.principla_name)) return false; } - boolean this_present_tbl_name = true && this.isSetTbl_name(); - boolean that_present_tbl_name = true && that.isSetTbl_name(); - if (this_present_tbl_name || that_present_tbl_name) { - if (!(this_present_tbl_name && that_present_tbl_name)) + boolean this_present_is_role = true; + boolean that_present_is_role = true; + if (this_present_is_role || that_present_is_role) { + if (!(this_present_is_role && that_present_is_role)) return false; - if (!this.tbl_name.equals(that.tbl_name)) + if (this.is_role != that.is_role) return false; } - boolean this_present_new_part = true && this.isSetNew_part(); - boolean that_present_new_part = true && that.isSetNew_part(); - if (this_present_new_part || that_present_new_part) { - if (!(this_present_new_part && that_present_new_part)) + boolean this_present_is_group = true; + boolean that_present_is_group = true; + if (this_present_is_group || that_present_is_group) { + if (!(this_present_is_group && that_present_is_group)) return false; - if (!this.new_part.equals(that.new_part)) + if (this.is_group != that.is_group) return false; } @@ -20943,24 +33330,25 @@ } switch (field.id) { - case DB_NAME: + case PRINCIPLA_NAME: if (field.type == TType.STRING) { - this.db_name = iprot.readString(); + this.principla_name = iprot.readString(); } else { TProtocolUtil.skip(iprot, field.type); } break; - case TBL_NAME: - if (field.type == TType.STRING) { - this.tbl_name = iprot.readString(); + case IS_ROLE: + if (field.type == TType.BOOL) { + this.is_role = iprot.readBool(); + this.__isset.is_role = true; } else { TProtocolUtil.skip(iprot, field.type); } break; - case NEW_PART: - if (field.type == TType.STRUCT) { - this.new_part = new Partition(); - this.new_part.read(iprot); + case IS_GROUP: + if (field.type == TType.BOOL) { + this.is_group = iprot.readBool(); + this.__isset.is_group = true; } else { TProtocolUtil.skip(iprot, field.type); } @@ -20980,52 +33368,40 @@ validate(); oprot.writeStructBegin(STRUCT_DESC); - if (this.db_name != null) { - oprot.writeFieldBegin(DB_NAME_FIELD_DESC); - oprot.writeString(this.db_name); - oprot.writeFieldEnd(); - } - if (this.tbl_name != null) { - oprot.writeFieldBegin(TBL_NAME_FIELD_DESC); - oprot.writeString(this.tbl_name); - oprot.writeFieldEnd(); - } - if (this.new_part != null) { - oprot.writeFieldBegin(NEW_PART_FIELD_DESC); - this.new_part.write(oprot); + if (this.principla_name != null) { + oprot.writeFieldBegin(PRINCIPLA_NAME_FIELD_DESC); + oprot.writeString(this.principla_name); oprot.writeFieldEnd(); } + oprot.writeFieldBegin(IS_ROLE_FIELD_DESC); + oprot.writeBool(this.is_role); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(IS_GROUP_FIELD_DESC); + oprot.writeBool(this.is_group); + oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } @Override public String toString() { - StringBuilder sb = new StringBuilder("alter_partition_args("); + StringBuilder sb = new StringBuilder("list_security_user_grant_args("); boolean first = true; - sb.append("db_name:"); - if (this.db_name == null) { + sb.append("principla_name:"); + if (this.principla_name == null) { sb.append("null"); } else { - sb.append(this.db_name); + sb.append(this.principla_name); } first = false; if (!first) sb.append(", "); - sb.append("tbl_name:"); - if (this.tbl_name == null) { - sb.append("null"); - } else { - sb.append(this.tbl_name); - } + sb.append("is_role:"); + sb.append(this.is_role); first = false; if (!first) sb.append(", "); - sb.append("new_part:"); - if (this.new_part == null) { - sb.append("null"); - } else { - sb.append(this.new_part); - } + sb.append("is_group:"); + sb.append(this.is_group); first = false; sb.append(")"); return sb.toString(); @@ -21038,65 +33414,102 @@ } - public static class alter_partition_result implements TBase, java.io.Serializable, Cloneable { - private static final TStruct STRUCT_DESC = new TStruct("alter_partition_result"); + public static class list_security_user_grant_result implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("list_security_user_grant_result"); + private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.LIST, (short)0); private static final TField O1_FIELD_DESC = new TField("o1", TType.STRUCT, (short)1); - private static final TField O2_FIELD_DESC = new TField("o2", TType.STRUCT, (short)2); - private InvalidOperationException o1; + private List success; + public static final int SUCCESS = 0; + private MetaException o1; public static final int O1 = 1; - private MetaException o2; - public static final int O2 = 2; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { } public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ + put(SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, + new ListMetaData(TType.LIST, + new StructMetaData(TType.STRUCT, SecurityUser.class)))); put(O1, new FieldMetaData("o1", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRUCT))); - put(O2, new FieldMetaData("o2", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRUCT))); }}); static { - FieldMetaData.addStructMetaDataMap(alter_partition_result.class, metaDataMap); + FieldMetaData.addStructMetaDataMap(list_security_user_grant_result.class, metaDataMap); + } + + public list_security_user_grant_result() { + } + + public list_security_user_grant_result( + List success, + MetaException o1) + { + this(); + this.success = success; + this.o1 = o1; + } + + /** + * Performs a deep copy on other. + */ + public list_security_user_grant_result(list_security_user_grant_result other) { + if (other.isSetSuccess()) { + List __this__success = new ArrayList(); + for (SecurityUser other_element : other.success) { + __this__success.add(new SecurityUser(other_element)); + } + this.success = __this__success; + } + if (other.isSetO1()) { + this.o1 = new MetaException(other.o1); + } + } + + @Override + public list_security_user_grant_result clone() { + return new list_security_user_grant_result(this); } - public alter_partition_result() { + public int getSuccessSize() { + return (this.success == null) ? 0 : this.success.size(); } - public alter_partition_result( - InvalidOperationException o1, - MetaException o2) - { - this(); - this.o1 = o1; - this.o2 = o2; + public java.util.Iterator getSuccessIterator() { + return (this.success == null) ? null : this.success.iterator(); } - /** - * Performs a deep copy on other. - */ - public alter_partition_result(alter_partition_result other) { - if (other.isSetO1()) { - this.o1 = new InvalidOperationException(other.o1); - } - if (other.isSetO2()) { - this.o2 = new MetaException(other.o2); + public void addToSuccess(SecurityUser elem) { + if (this.success == null) { + this.success = new ArrayList(); } + this.success.add(elem); } - @Override - public alter_partition_result clone() { - return new alter_partition_result(this); + public List getSuccess() { + return this.success; } - public InvalidOperationException getO1() { + public void setSuccess(List success) { + this.success = success; + } + + public void unsetSuccess() { + this.success = null; + } + + // Returns true if field success is set (has been asigned a value) and false otherwise + public boolean isSetSuccess() { + return this.success != null; + } + + public MetaException getO1() { return this.o1; } - public void setO1(InvalidOperationException o1) { + public void setO1(MetaException o1) { this.o1 = o1; } @@ -21109,38 +33522,21 @@ return this.o1 != null; } - public MetaException getO2() { - return this.o2; - } - - public void setO2(MetaException o2) { - this.o2 = o2; - } - - public void unsetO2() { - this.o2 = null; - } - - // Returns true if field o2 is set (has been asigned a value) and false otherwise - public boolean isSetO2() { - return this.o2 != null; - } - public void setFieldValue(int fieldID, Object value) { switch (fieldID) { - case O1: + case SUCCESS: if (value == null) { - unsetO1(); + unsetSuccess(); } else { - setO1((InvalidOperationException)value); + setSuccess((List)value); } break; - case O2: + case O1: if (value == null) { - unsetO2(); + unsetO1(); } else { - setO2((MetaException)value); + setO1((MetaException)value); } break; @@ -21151,12 +33547,12 @@ public Object getFieldValue(int fieldID) { switch (fieldID) { + case SUCCESS: + return getSuccess(); + case O1: return getO1(); - case O2: - return getO2(); - default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -21165,10 +33561,10 @@ // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise public boolean isSet(int fieldID) { switch (fieldID) { + case SUCCESS: + return isSetSuccess(); case O1: return isSetO1(); - case O2: - return isSetO2(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -21178,15 +33574,24 @@ public boolean equals(Object that) { if (that == null) return false; - if (that instanceof alter_partition_result) - return this.equals((alter_partition_result)that); + if (that instanceof list_security_user_grant_result) + return this.equals((list_security_user_grant_result)that); return false; } - public boolean equals(alter_partition_result that) { + public boolean equals(list_security_user_grant_result that) { if (that == null) return false; + boolean this_present_success = true && this.isSetSuccess(); + boolean that_present_success = true && that.isSetSuccess(); + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (!this.success.equals(that.success)) + return false; + } + boolean this_present_o1 = true && this.isSetO1(); boolean that_present_o1 = true && that.isSetO1(); if (this_present_o1 || that_present_o1) { @@ -21196,15 +33601,6 @@ return false; } - boolean this_present_o2 = true && this.isSetO2(); - boolean that_present_o2 = true && that.isSetO2(); - if (this_present_o2 || that_present_o2) { - if (!(this_present_o2 && that_present_o2)) - return false; - if (!this.o2.equals(that.o2)) - return false; - } - return true; } @@ -21224,18 +33620,28 @@ } switch (field.id) { - case O1: - if (field.type == TType.STRUCT) { - this.o1 = new InvalidOperationException(); - this.o1.read(iprot); + case SUCCESS: + if (field.type == TType.LIST) { + { + TList _list203 = iprot.readListBegin(); + this.success = new ArrayList(_list203.size); + for (int _i204 = 0; _i204 < _list203.size; ++_i204) + { + SecurityUser _elem205; + _elem205 = new SecurityUser(); + _elem205.read(iprot); + this.success.add(_elem205); + } + iprot.readListEnd(); + } } else { TProtocolUtil.skip(iprot, field.type); } break; - case O2: + case O1: if (field.type == TType.STRUCT) { - this.o2 = new MetaException(); - this.o2.read(iprot); + this.o1 = new MetaException(); + this.o1.read(iprot); } else { TProtocolUtil.skip(iprot, field.type); } @@ -21254,14 +33660,20 @@ public void write(TProtocol oprot) throws TException { oprot.writeStructBegin(STRUCT_DESC); - if (this.isSetO1()) { + if (this.isSetSuccess()) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + { + oprot.writeListBegin(new TList(TType.STRUCT, this.success.size())); + for (SecurityUser _iter206 : this.success) { + _iter206.write(oprot); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } else if (this.isSetO1()) { oprot.writeFieldBegin(O1_FIELD_DESC); this.o1.write(oprot); oprot.writeFieldEnd(); - } else if (this.isSetO2()) { - oprot.writeFieldBegin(O2_FIELD_DESC); - this.o2.write(oprot); - oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); @@ -21269,22 +33681,22 @@ @Override public String toString() { - StringBuilder sb = new StringBuilder("alter_partition_result("); + StringBuilder sb = new StringBuilder("list_security_user_grant_result("); boolean first = true; - sb.append("o1:"); - if (this.o1 == null) { + sb.append("success:"); + if (this.success == null) { sb.append("null"); } else { - sb.append(this.o1); + sb.append(this.success); } first = false; if (!first) sb.append(", "); - sb.append("o2:"); - if (this.o2 == null) { + sb.append("o1:"); + if (this.o1 == null) { sb.append("null"); } else { - sb.append(this.o2); + sb.append(this.o1); } first = false; sb.append(")"); @@ -21298,109 +33710,183 @@ } - public static class get_config_value_args implements TBase, java.io.Serializable, Cloneable { - private static final TStruct STRUCT_DESC = new TStruct("get_config_value_args"); - private static final TField NAME_FIELD_DESC = new TField("name", TType.STRING, (short)1); - private static final TField DEFAULT_VALUE_FIELD_DESC = new TField("defaultValue", TType.STRING, (short)2); + public static class list_security_db_grant_args implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("list_security_db_grant_args"); + private static final TField PRINCIPAL_NAME_FIELD_DESC = new TField("principal_name", TType.STRING, (short)1); + private static final TField IS_GROUP_FIELD_DESC = new TField("is_group", TType.BOOL, (short)2); + private static final TField IS_ROLE_FIELD_DESC = new TField("is_role", TType.BOOL, (short)3); + private static final TField DB_NAME_FIELD_DESC = new TField("db_name", TType.STRING, (short)4); - private String name; - public static final int NAME = 1; - private String defaultValue; - public static final int DEFAULTVALUE = 2; + private String principal_name; + public static final int PRINCIPAL_NAME = 1; + private boolean is_group; + public static final int IS_GROUP = 2; + private boolean is_role; + public static final int IS_ROLE = 3; + private String db_name; + public static final int DB_NAME = 4; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { + public boolean is_group = false; + public boolean is_role = false; } public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ - put(NAME, new FieldMetaData("name", TFieldRequirementType.DEFAULT, + put(PRINCIPAL_NAME, new FieldMetaData("principal_name", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRING))); - put(DEFAULTVALUE, new FieldMetaData("defaultValue", TFieldRequirementType.DEFAULT, + put(IS_GROUP, new FieldMetaData("is_group", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.BOOL))); + put(IS_ROLE, new FieldMetaData("is_role", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.BOOL))); + put(DB_NAME, new FieldMetaData("db_name", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRING))); }}); static { - FieldMetaData.addStructMetaDataMap(get_config_value_args.class, metaDataMap); + FieldMetaData.addStructMetaDataMap(list_security_db_grant_args.class, metaDataMap); } - public get_config_value_args() { + public list_security_db_grant_args() { } - public get_config_value_args( - String name, - String defaultValue) + public list_security_db_grant_args( + String principal_name, + boolean is_group, + boolean is_role, + String db_name) { this(); - this.name = name; - this.defaultValue = defaultValue; + this.principal_name = principal_name; + this.is_group = is_group; + this.__isset.is_group = true; + this.is_role = is_role; + this.__isset.is_role = true; + this.db_name = db_name; + } + + /** + * Performs a deep copy on other. + */ + public list_security_db_grant_args(list_security_db_grant_args other) { + if (other.isSetPrincipal_name()) { + this.principal_name = other.principal_name; + } + __isset.is_group = other.__isset.is_group; + this.is_group = other.is_group; + __isset.is_role = other.__isset.is_role; + this.is_role = other.is_role; + if (other.isSetDb_name()) { + this.db_name = other.db_name; + } + } + + @Override + public list_security_db_grant_args clone() { + return new list_security_db_grant_args(this); + } + + public String getPrincipal_name() { + return this.principal_name; + } + + public void setPrincipal_name(String principal_name) { + this.principal_name = principal_name; + } + + public void unsetPrincipal_name() { + this.principal_name = null; + } + + // Returns true if field principal_name is set (has been asigned a value) and false otherwise + public boolean isSetPrincipal_name() { + return this.principal_name != null; + } + + public boolean isIs_group() { + return this.is_group; } - /** - * Performs a deep copy on other. - */ - public get_config_value_args(get_config_value_args other) { - if (other.isSetName()) { - this.name = other.name; - } - if (other.isSetDefaultValue()) { - this.defaultValue = other.defaultValue; - } + public void setIs_group(boolean is_group) { + this.is_group = is_group; + this.__isset.is_group = true; } - @Override - public get_config_value_args clone() { - return new get_config_value_args(this); + public void unsetIs_group() { + this.__isset.is_group = false; } - public String getName() { - return this.name; + // Returns true if field is_group is set (has been asigned a value) and false otherwise + public boolean isSetIs_group() { + return this.__isset.is_group; } - public void setName(String name) { - this.name = name; + public boolean isIs_role() { + return this.is_role; } - public void unsetName() { - this.name = null; + public void setIs_role(boolean is_role) { + this.is_role = is_role; + this.__isset.is_role = true; } - // Returns true if field name is set (has been asigned a value) and false otherwise - public boolean isSetName() { - return this.name != null; + public void unsetIs_role() { + this.__isset.is_role = false; } - public String getDefaultValue() { - return this.defaultValue; + // Returns true if field is_role is set (has been asigned a value) and false otherwise + public boolean isSetIs_role() { + return this.__isset.is_role; } - public void setDefaultValue(String defaultValue) { - this.defaultValue = defaultValue; + public String getDb_name() { + return this.db_name; } - public void unsetDefaultValue() { - this.defaultValue = null; + public void setDb_name(String db_name) { + this.db_name = db_name; } - // Returns true if field defaultValue is set (has been asigned a value) and false otherwise - public boolean isSetDefaultValue() { - return this.defaultValue != null; + public void unsetDb_name() { + this.db_name = null; + } + + // Returns true if field db_name is set (has been asigned a value) and false otherwise + public boolean isSetDb_name() { + return this.db_name != null; } public void setFieldValue(int fieldID, Object value) { switch (fieldID) { - case NAME: + case PRINCIPAL_NAME: if (value == null) { - unsetName(); + unsetPrincipal_name(); } else { - setName((String)value); + setPrincipal_name((String)value); } break; - case DEFAULTVALUE: + case IS_GROUP: if (value == null) { - unsetDefaultValue(); + unsetIs_group(); } else { - setDefaultValue((String)value); + setIs_group((Boolean)value); + } + break; + + case IS_ROLE: + if (value == null) { + unsetIs_role(); + } else { + setIs_role((Boolean)value); + } + break; + + case DB_NAME: + if (value == null) { + unsetDb_name(); + } else { + setDb_name((String)value); } break; @@ -21411,11 +33897,17 @@ public Object getFieldValue(int fieldID) { switch (fieldID) { - case NAME: - return getName(); + case PRINCIPAL_NAME: + return getPrincipal_name(); - case DEFAULTVALUE: - return getDefaultValue(); + case IS_GROUP: + return new Boolean(isIs_group()); + + case IS_ROLE: + return new Boolean(isIs_role()); + + case DB_NAME: + return getDb_name(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); @@ -21425,10 +33917,14 @@ // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise public boolean isSet(int fieldID) { switch (fieldID) { - case NAME: - return isSetName(); - case DEFAULTVALUE: - return isSetDefaultValue(); + case PRINCIPAL_NAME: + return isSetPrincipal_name(); + case IS_GROUP: + return isSetIs_group(); + case IS_ROLE: + return isSetIs_role(); + case DB_NAME: + return isSetDb_name(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -21438,30 +33934,48 @@ public boolean equals(Object that) { if (that == null) return false; - if (that instanceof get_config_value_args) - return this.equals((get_config_value_args)that); + if (that instanceof list_security_db_grant_args) + return this.equals((list_security_db_grant_args)that); return false; } - public boolean equals(get_config_value_args that) { + public boolean equals(list_security_db_grant_args 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)) + boolean this_present_principal_name = true && this.isSetPrincipal_name(); + boolean that_present_principal_name = true && that.isSetPrincipal_name(); + if (this_present_principal_name || that_present_principal_name) { + if (!(this_present_principal_name && that_present_principal_name)) return false; - if (!this.name.equals(that.name)) + if (!this.principal_name.equals(that.principal_name)) return false; } - boolean this_present_defaultValue = true && this.isSetDefaultValue(); - boolean that_present_defaultValue = true && that.isSetDefaultValue(); - if (this_present_defaultValue || that_present_defaultValue) { - if (!(this_present_defaultValue && that_present_defaultValue)) + boolean this_present_is_group = true; + boolean that_present_is_group = true; + if (this_present_is_group || that_present_is_group) { + if (!(this_present_is_group && that_present_is_group)) return false; - if (!this.defaultValue.equals(that.defaultValue)) + if (this.is_group != that.is_group) + return false; + } + + boolean this_present_is_role = true; + boolean that_present_is_role = true; + if (this_present_is_role || that_present_is_role) { + if (!(this_present_is_role && that_present_is_role)) + return false; + if (this.is_role != that.is_role) + 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) { + if (!(this_present_db_name && that_present_db_name)) + return false; + if (!this.db_name.equals(that.db_name)) return false; } @@ -21484,16 +33998,32 @@ } switch (field.id) { - case NAME: + case PRINCIPAL_NAME: if (field.type == TType.STRING) { - this.name = iprot.readString(); + this.principal_name = iprot.readString(); } else { TProtocolUtil.skip(iprot, field.type); } break; - case DEFAULTVALUE: + case IS_GROUP: + if (field.type == TType.BOOL) { + this.is_group = iprot.readBool(); + this.__isset.is_group = true; + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case IS_ROLE: + if (field.type == TType.BOOL) { + this.is_role = iprot.readBool(); + this.__isset.is_role = true; + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case DB_NAME: if (field.type == TType.STRING) { - this.defaultValue = iprot.readString(); + this.db_name = iprot.readString(); } else { TProtocolUtil.skip(iprot, field.type); } @@ -21513,14 +34043,20 @@ validate(); oprot.writeStructBegin(STRUCT_DESC); - if (this.name != null) { - oprot.writeFieldBegin(NAME_FIELD_DESC); - oprot.writeString(this.name); + if (this.principal_name != null) { + oprot.writeFieldBegin(PRINCIPAL_NAME_FIELD_DESC); + oprot.writeString(this.principal_name); oprot.writeFieldEnd(); } - if (this.defaultValue != null) { - oprot.writeFieldBegin(DEFAULT_VALUE_FIELD_DESC); - oprot.writeString(this.defaultValue); + oprot.writeFieldBegin(IS_GROUP_FIELD_DESC); + oprot.writeBool(this.is_group); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(IS_ROLE_FIELD_DESC); + oprot.writeBool(this.is_role); + oprot.writeFieldEnd(); + if (this.db_name != null) { + oprot.writeFieldBegin(DB_NAME_FIELD_DESC); + oprot.writeString(this.db_name); oprot.writeFieldEnd(); } oprot.writeFieldStop(); @@ -21529,22 +34065,30 @@ @Override public String toString() { - StringBuilder sb = new StringBuilder("get_config_value_args("); + StringBuilder sb = new StringBuilder("list_security_db_grant_args("); boolean first = true; - sb.append("name:"); - if (this.name == null) { + sb.append("principal_name:"); + if (this.principal_name == null) { sb.append("null"); } else { - sb.append(this.name); + sb.append(this.principal_name); } first = false; if (!first) sb.append(", "); - sb.append("defaultValue:"); - if (this.defaultValue == null) { + sb.append("is_group:"); + sb.append(this.is_group); + first = false; + if (!first) sb.append(", "); + sb.append("is_role:"); + sb.append(this.is_role); + first = false; + if (!first) sb.append(", "); + sb.append("db_name:"); + if (this.db_name == null) { sb.append("null"); } else { - sb.append(this.defaultValue); + sb.append(this.db_name); } first = false; sb.append(")"); @@ -21558,14 +34102,14 @@ } - public static class get_config_value_result implements TBase, java.io.Serializable, Cloneable { - private static final TStruct STRUCT_DESC = new TStruct("get_config_value_result"); - private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.STRING, (short)0); + public static class list_security_db_grant_result implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("list_security_db_grant_result"); + private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.LIST, (short)0); private static final TField O1_FIELD_DESC = new TField("o1", TType.STRUCT, (short)1); - private String success; + private List success; public static final int SUCCESS = 0; - private ConfigValSecurityException o1; + private MetaException o1; public static final int O1 = 1; private final Isset __isset = new Isset(); @@ -21574,21 +34118,22 @@ public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ put(SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRING))); + new ListMetaData(TType.LIST, + new StructMetaData(TType.STRUCT, SecurityDB.class)))); put(O1, new FieldMetaData("o1", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRUCT))); }}); static { - FieldMetaData.addStructMetaDataMap(get_config_value_result.class, metaDataMap); + FieldMetaData.addStructMetaDataMap(list_security_db_grant_result.class, metaDataMap); } - public get_config_value_result() { + public list_security_db_grant_result() { } - public get_config_value_result( - String success, - ConfigValSecurityException o1) + public list_security_db_grant_result( + List success, + MetaException o1) { this(); this.success = success; @@ -21598,25 +34143,44 @@ /** * Performs a deep copy on other. */ - public get_config_value_result(get_config_value_result other) { + public list_security_db_grant_result(list_security_db_grant_result other) { if (other.isSetSuccess()) { - this.success = other.success; + List __this__success = new ArrayList(); + for (SecurityDB other_element : other.success) { + __this__success.add(new SecurityDB(other_element)); + } + this.success = __this__success; } if (other.isSetO1()) { - this.o1 = new ConfigValSecurityException(other.o1); + this.o1 = new MetaException(other.o1); } } @Override - public get_config_value_result clone() { - return new get_config_value_result(this); + public list_security_db_grant_result clone() { + return new list_security_db_grant_result(this); } - public String getSuccess() { + public int getSuccessSize() { + return (this.success == null) ? 0 : this.success.size(); + } + + public java.util.Iterator getSuccessIterator() { + return (this.success == null) ? null : this.success.iterator(); + } + + public void addToSuccess(SecurityDB elem) { + if (this.success == null) { + this.success = new ArrayList(); + } + this.success.add(elem); + } + + public List getSuccess() { return this.success; } - public void setSuccess(String success) { + public void setSuccess(List success) { this.success = success; } @@ -21629,11 +34193,11 @@ return this.success != null; } - public ConfigValSecurityException getO1() { + public MetaException getO1() { return this.o1; } - public void setO1(ConfigValSecurityException o1) { + public void setO1(MetaException o1) { this.o1 = o1; } @@ -21652,7 +34216,7 @@ if (value == null) { unsetSuccess(); } else { - setSuccess((String)value); + setSuccess((List)value); } break; @@ -21660,7 +34224,7 @@ if (value == null) { unsetO1(); } else { - setO1((ConfigValSecurityException)value); + setO1((MetaException)value); } break; @@ -21698,12 +34262,12 @@ public boolean equals(Object that) { if (that == null) return false; - if (that instanceof get_config_value_result) - return this.equals((get_config_value_result)that); + if (that instanceof list_security_db_grant_result) + return this.equals((list_security_db_grant_result)that); return false; } - public boolean equals(get_config_value_result that) { + public boolean equals(list_security_db_grant_result that) { if (that == null) return false; @@ -21745,15 +34309,26 @@ switch (field.id) { case SUCCESS: - if (field.type == TType.STRING) { - this.success = iprot.readString(); + if (field.type == TType.LIST) { + { + TList _list207 = iprot.readListBegin(); + this.success = new ArrayList(_list207.size); + for (int _i208 = 0; _i208 < _list207.size; ++_i208) + { + SecurityDB _elem209; + _elem209 = new SecurityDB(); + _elem209.read(iprot); + this.success.add(_elem209); + } + iprot.readListEnd(); + } } else { TProtocolUtil.skip(iprot, field.type); } break; case O1: if (field.type == TType.STRUCT) { - this.o1 = new ConfigValSecurityException(); + this.o1 = new MetaException(); this.o1.read(iprot); } else { TProtocolUtil.skip(iprot, field.type); @@ -21775,7 +34350,13 @@ if (this.isSetSuccess()) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - oprot.writeString(this.success); + { + oprot.writeListBegin(new TList(TType.STRUCT, this.success.size())); + for (SecurityDB _iter210 : this.success) { + _iter210.write(oprot); + } + oprot.writeListEnd(); + } oprot.writeFieldEnd(); } else if (this.isSetO1()) { oprot.writeFieldBegin(O1_FIELD_DESC); @@ -21788,7 +34369,7 @@ @Override public String toString() { - StringBuilder sb = new StringBuilder("get_config_value_result("); + StringBuilder sb = new StringBuilder("list_security_db_grant_result("); boolean first = true; sb.append("success:"); @@ -21817,320 +34398,218 @@ } - public static class partition_name_to_vals_args implements TBase, java.io.Serializable, Cloneable { - private static final TStruct STRUCT_DESC = new TStruct("partition_name_to_vals_args"); - private static final TField PART_NAME_FIELD_DESC = new TField("part_name", TType.STRING, (short)1); + public static class list_security_table_grant_args implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("list_security_table_grant_args"); + private static final TField PRINCIPAL_NAME_FIELD_DESC = new TField("principal_name", TType.STRING, (short)1); + private static final TField IS_GROUP_FIELD_DESC = new TField("is_group", TType.BOOL, (short)2); + private static final TField IS_ROLE_FIELD_DESC = new TField("is_role", TType.BOOL, (short)3); + private static final TField DB_NAME_FIELD_DESC = new TField("db_name", TType.STRING, (short)4); + private static final TField TABLE_NAME_FIELD_DESC = new TField("table_name", TType.STRING, (short)5); - private String part_name; - public static final int PART_NAME = 1; + private String principal_name; + public static final int PRINCIPAL_NAME = 1; + private boolean is_group; + public static final int IS_GROUP = 2; + private boolean is_role; + public static final int IS_ROLE = 3; + private String db_name; + public static final int DB_NAME = 4; + private String table_name; + public static final int TABLE_NAME = 5; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { + public boolean is_group = false; + public boolean is_role = false; } public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ - put(PART_NAME, new FieldMetaData("part_name", TFieldRequirementType.DEFAULT, + put(PRINCIPAL_NAME, new FieldMetaData("principal_name", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + put(IS_GROUP, new FieldMetaData("is_group", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.BOOL))); + put(IS_ROLE, new FieldMetaData("is_role", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.BOOL))); + put(DB_NAME, new FieldMetaData("db_name", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + put(TABLE_NAME, new FieldMetaData("table_name", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRING))); }}); static { - FieldMetaData.addStructMetaDataMap(partition_name_to_vals_args.class, metaDataMap); + FieldMetaData.addStructMetaDataMap(list_security_table_grant_args.class, metaDataMap); } - public partition_name_to_vals_args() { + public list_security_table_grant_args() { } - public partition_name_to_vals_args( - String part_name) + public list_security_table_grant_args( + String principal_name, + boolean is_group, + boolean is_role, + String db_name, + String table_name) { this(); - this.part_name = part_name; + this.principal_name = principal_name; + this.is_group = is_group; + this.__isset.is_group = true; + this.is_role = is_role; + this.__isset.is_role = true; + this.db_name = db_name; + this.table_name = table_name; } /** * Performs a deep copy on other. */ - public partition_name_to_vals_args(partition_name_to_vals_args other) { - if (other.isSetPart_name()) { - this.part_name = other.part_name; - } - } - - @Override - public partition_name_to_vals_args clone() { - return new partition_name_to_vals_args(this); - } - - public String getPart_name() { - return this.part_name; - } - - public void setPart_name(String part_name) { - this.part_name = part_name; - } - - public void unsetPart_name() { - this.part_name = null; - } - - // Returns true if field part_name is set (has been asigned a value) and false otherwise - public boolean isSetPart_name() { - return this.part_name != null; - } - - public void setFieldValue(int fieldID, Object value) { - switch (fieldID) { - case PART_NAME: - if (value == null) { - unsetPart_name(); - } else { - setPart_name((String)value); - } - break; - - default: - throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); - } - } - - public Object getFieldValue(int fieldID) { - switch (fieldID) { - case PART_NAME: - return getPart_name(); - - default: - throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); - } - } - - // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise - public boolean isSet(int fieldID) { - switch (fieldID) { - case PART_NAME: - return isSetPart_name(); - default: - throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); - } - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof partition_name_to_vals_args) - return this.equals((partition_name_to_vals_args)that); - return false; - } - - public boolean equals(partition_name_to_vals_args that) { - if (that == null) - return false; - - boolean this_present_part_name = true && this.isSetPart_name(); - boolean that_present_part_name = true && that.isSetPart_name(); - if (this_present_part_name || that_present_part_name) { - if (!(this_present_part_name && that_present_part_name)) - return false; - if (!this.part_name.equals(that.part_name)) - return false; + public list_security_table_grant_args(list_security_table_grant_args other) { + if (other.isSetPrincipal_name()) { + this.principal_name = other.principal_name; } - - return true; - } - - @Override - public int hashCode() { - return 0; - } - - public void read(TProtocol iprot) throws TException { - TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == TType.STOP) { - break; - } - switch (field.id) - { - case PART_NAME: - if (field.type == TType.STRING) { - this.part_name = iprot.readString(); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - default: - TProtocolUtil.skip(iprot, field.type); - break; - } - iprot.readFieldEnd(); + __isset.is_group = other.__isset.is_group; + this.is_group = other.is_group; + __isset.is_role = other.__isset.is_role; + this.is_role = other.is_role; + if (other.isSetDb_name()) { + this.db_name = other.db_name; } - iprot.readStructEnd(); - - validate(); - } - - public void write(TProtocol oprot) throws TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.part_name != null) { - oprot.writeFieldBegin(PART_NAME_FIELD_DESC); - oprot.writeString(this.part_name); - oprot.writeFieldEnd(); + if (other.isSetTable_name()) { + this.table_name = other.table_name; } - oprot.writeFieldStop(); - oprot.writeStructEnd(); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("partition_name_to_vals_args("); - boolean first = true; - - sb.append("part_name:"); - if (this.part_name == null) { - sb.append("null"); - } else { - sb.append(this.part_name); - } - first = false; - sb.append(")"); - return sb.toString(); + public list_security_table_grant_args clone() { + return new list_security_table_grant_args(this); } - public void validate() throws TException { - // check for required fields - // check that fields of type enum have valid values + public String getPrincipal_name() { + return this.principal_name; } - } - - public static class partition_name_to_vals_result implements TBase, java.io.Serializable, Cloneable { - private static final TStruct STRUCT_DESC = new TStruct("partition_name_to_vals_result"); - private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.LIST, (short)0); - private static final TField O1_FIELD_DESC = new TField("o1", TType.STRUCT, (short)1); - - private List success; - public static final int SUCCESS = 0; - private MetaException o1; - public static final int O1 = 1; + public void setPrincipal_name(String principal_name) { + this.principal_name = principal_name; + } - private final Isset __isset = new Isset(); - private static final class Isset implements java.io.Serializable { + public void unsetPrincipal_name() { + this.principal_name = null; } - public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ - put(SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, - new ListMetaData(TType.LIST, - new FieldValueMetaData(TType.STRING)))); - put(O1, new FieldMetaData("o1", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRUCT))); - }}); + // Returns true if field principal_name is set (has been asigned a value) and false otherwise + public boolean isSetPrincipal_name() { + return this.principal_name != null; + } - static { - FieldMetaData.addStructMetaDataMap(partition_name_to_vals_result.class, metaDataMap); + public boolean isIs_group() { + return this.is_group; } - public partition_name_to_vals_result() { + public void setIs_group(boolean is_group) { + this.is_group = is_group; + this.__isset.is_group = true; } - public partition_name_to_vals_result( - List success, - MetaException o1) - { - this(); - this.success = success; - this.o1 = o1; + public void unsetIs_group() { + this.__isset.is_group = false; } - /** - * Performs a deep copy on other. - */ - public partition_name_to_vals_result(partition_name_to_vals_result other) { - if (other.isSetSuccess()) { - List __this__success = new ArrayList(); - for (String other_element : other.success) { - __this__success.add(other_element); - } - this.success = __this__success; - } - if (other.isSetO1()) { - this.o1 = new MetaException(other.o1); - } + // Returns true if field is_group is set (has been asigned a value) and false otherwise + public boolean isSetIs_group() { + return this.__isset.is_group; } - @Override - public partition_name_to_vals_result clone() { - return new partition_name_to_vals_result(this); + public boolean isIs_role() { + return this.is_role; } - public int getSuccessSize() { - return (this.success == null) ? 0 : this.success.size(); + public void setIs_role(boolean is_role) { + this.is_role = is_role; + this.__isset.is_role = true; } - public java.util.Iterator getSuccessIterator() { - return (this.success == null) ? null : this.success.iterator(); + public void unsetIs_role() { + this.__isset.is_role = false; } - public void addToSuccess(String elem) { - if (this.success == null) { - this.success = new ArrayList(); - } - this.success.add(elem); + // Returns true if field is_role is set (has been asigned a value) and false otherwise + public boolean isSetIs_role() { + return this.__isset.is_role; } - public List getSuccess() { - return this.success; + public String getDb_name() { + return this.db_name; } - public void setSuccess(List success) { - this.success = success; + public void setDb_name(String db_name) { + this.db_name = db_name; } - public void unsetSuccess() { - this.success = null; + public void unsetDb_name() { + this.db_name = null; } - // Returns true if field success is set (has been asigned a value) and false otherwise - public boolean isSetSuccess() { - return this.success != null; + // Returns true if field db_name is set (has been asigned a value) and false otherwise + public boolean isSetDb_name() { + return this.db_name != null; } - public MetaException getO1() { - return this.o1; + public String getTable_name() { + return this.table_name; } - public void setO1(MetaException o1) { - this.o1 = o1; + public void setTable_name(String table_name) { + this.table_name = table_name; } - public void unsetO1() { - this.o1 = null; + public void unsetTable_name() { + this.table_name = null; } - // Returns true if field o1 is set (has been asigned a value) and false otherwise - public boolean isSetO1() { - return this.o1 != null; + // Returns true if field table_name is set (has been asigned a value) and false otherwise + public boolean isSetTable_name() { + return this.table_name != null; } public void setFieldValue(int fieldID, Object value) { switch (fieldID) { - case SUCCESS: + case PRINCIPAL_NAME: if (value == null) { - unsetSuccess(); + unsetPrincipal_name(); } else { - setSuccess((List)value); + setPrincipal_name((String)value); } break; - case O1: + case IS_GROUP: if (value == null) { - unsetO1(); + unsetIs_group(); } else { - setO1((MetaException)value); + setIs_group((Boolean)value); + } + break; + + case IS_ROLE: + if (value == null) { + unsetIs_role(); + } else { + setIs_role((Boolean)value); + } + break; + + case DB_NAME: + if (value == null) { + unsetDb_name(); + } else { + setDb_name((String)value); + } + break; + + case TABLE_NAME: + if (value == null) { + unsetTable_name(); + } else { + setTable_name((String)value); } break; @@ -22141,11 +34620,20 @@ public Object getFieldValue(int fieldID) { switch (fieldID) { - case SUCCESS: - return getSuccess(); + case PRINCIPAL_NAME: + return getPrincipal_name(); - case O1: - return getO1(); + case IS_GROUP: + return new Boolean(isIs_group()); + + case IS_ROLE: + return new Boolean(isIs_role()); + + case DB_NAME: + return getDb_name(); + + case TABLE_NAME: + return getTable_name(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); @@ -22155,10 +34643,16 @@ // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise public boolean isSet(int fieldID) { switch (fieldID) { - case SUCCESS: - return isSetSuccess(); - case O1: - return isSetO1(); + case PRINCIPAL_NAME: + return isSetPrincipal_name(); + case IS_GROUP: + return isSetIs_group(); + case IS_ROLE: + return isSetIs_role(); + case DB_NAME: + return isSetDb_name(); + case TABLE_NAME: + return isSetTable_name(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -22168,30 +34662,57 @@ public boolean equals(Object that) { if (that == null) return false; - if (that instanceof partition_name_to_vals_result) - return this.equals((partition_name_to_vals_result)that); + if (that instanceof list_security_table_grant_args) + return this.equals((list_security_table_grant_args)that); return false; } - public boolean equals(partition_name_to_vals_result that) { + public boolean equals(list_security_table_grant_args that) { if (that == null) return false; - boolean this_present_success = true && this.isSetSuccess(); - boolean that_present_success = true && that.isSetSuccess(); - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) + boolean this_present_principal_name = true && this.isSetPrincipal_name(); + boolean that_present_principal_name = true && that.isSetPrincipal_name(); + if (this_present_principal_name || that_present_principal_name) { + if (!(this_present_principal_name && that_present_principal_name)) return false; - if (!this.success.equals(that.success)) + if (!this.principal_name.equals(that.principal_name)) return false; } - boolean this_present_o1 = true && this.isSetO1(); - boolean that_present_o1 = true && that.isSetO1(); - if (this_present_o1 || that_present_o1) { - if (!(this_present_o1 && that_present_o1)) + boolean this_present_is_group = true; + boolean that_present_is_group = true; + if (this_present_is_group || that_present_is_group) { + if (!(this_present_is_group && that_present_is_group)) + return false; + if (this.is_group != that.is_group) + return false; + } + + boolean this_present_is_role = true; + boolean that_present_is_role = true; + if (this_present_is_role || that_present_is_role) { + if (!(this_present_is_role && that_present_is_role)) + return false; + if (this.is_role != that.is_role) + 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) { + if (!(this_present_db_name && that_present_db_name)) + return false; + if (!this.db_name.equals(that.db_name)) return false; - if (!this.o1.equals(that.o1)) + } + + boolean this_present_table_name = true && this.isSetTable_name(); + boolean that_present_table_name = true && that.isSetTable_name(); + if (this_present_table_name || that_present_table_name) { + if (!(this_present_table_name && that_present_table_name)) + return false; + if (!this.table_name.equals(that.table_name)) return false; } @@ -22214,27 +34735,39 @@ } switch (field.id) { - case SUCCESS: - if (field.type == TType.LIST) { - { - TList _list127 = iprot.readListBegin(); - this.success = new ArrayList(_list127.size); - for (int _i128 = 0; _i128 < _list127.size; ++_i128) - { - String _elem129; - _elem129 = iprot.readString(); - this.success.add(_elem129); - } - iprot.readListEnd(); - } + case PRINCIPAL_NAME: + if (field.type == TType.STRING) { + this.principal_name = iprot.readString(); } else { TProtocolUtil.skip(iprot, field.type); } break; - case O1: - if (field.type == TType.STRUCT) { - this.o1 = new MetaException(); - this.o1.read(iprot); + case IS_GROUP: + if (field.type == TType.BOOL) { + this.is_group = iprot.readBool(); + this.__isset.is_group = true; + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case IS_ROLE: + if (field.type == TType.BOOL) { + this.is_role = iprot.readBool(); + this.__isset.is_role = true; + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case DB_NAME: + if (field.type == TType.STRING) { + this.db_name = iprot.readString(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case TABLE_NAME: + if (field.type == TType.STRING) { + this.table_name = iprot.readString(); } else { TProtocolUtil.skip(iprot, field.type); } @@ -22251,21 +34784,28 @@ } public void write(TProtocol oprot) throws TException { - oprot.writeStructBegin(STRUCT_DESC); + validate(); - if (this.isSetSuccess()) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - { - oprot.writeListBegin(new TList(TType.STRING, this.success.size())); - for (String _iter130 : this.success) { - oprot.writeString(_iter130); - } - oprot.writeListEnd(); - } + oprot.writeStructBegin(STRUCT_DESC); + if (this.principal_name != null) { + oprot.writeFieldBegin(PRINCIPAL_NAME_FIELD_DESC); + oprot.writeString(this.principal_name); oprot.writeFieldEnd(); - } else if (this.isSetO1()) { - oprot.writeFieldBegin(O1_FIELD_DESC); - this.o1.write(oprot); + } + oprot.writeFieldBegin(IS_GROUP_FIELD_DESC); + oprot.writeBool(this.is_group); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(IS_ROLE_FIELD_DESC); + oprot.writeBool(this.is_role); + oprot.writeFieldEnd(); + if (this.db_name != null) { + oprot.writeFieldBegin(DB_NAME_FIELD_DESC); + oprot.writeString(this.db_name); + oprot.writeFieldEnd(); + } + if (this.table_name != null) { + oprot.writeFieldBegin(TABLE_NAME_FIELD_DESC); + oprot.writeString(this.table_name); oprot.writeFieldEnd(); } oprot.writeFieldStop(); @@ -22274,22 +34814,38 @@ @Override public String toString() { - StringBuilder sb = new StringBuilder("partition_name_to_vals_result("); + StringBuilder sb = new StringBuilder("list_security_table_grant_args("); boolean first = true; - sb.append("success:"); - if (this.success == null) { + sb.append("principal_name:"); + if (this.principal_name == null) { sb.append("null"); } else { - sb.append(this.success); + sb.append(this.principal_name); } first = false; if (!first) sb.append(", "); - sb.append("o1:"); - if (this.o1 == null) { + sb.append("is_group:"); + sb.append(this.is_group); + first = false; + if (!first) sb.append(", "); + sb.append("is_role:"); + sb.append(this.is_role); + first = false; + if (!first) sb.append(", "); + sb.append("db_name:"); + if (this.db_name == null) { sb.append("null"); } else { - sb.append(this.o1); + sb.append(this.db_name); + } + first = false; + if (!first) sb.append(", "); + sb.append("table_name:"); + if (this.table_name == null) { + sb.append("null"); + } else { + sb.append(this.table_name); } first = false; sb.append(")"); @@ -22303,74 +34859,129 @@ } - public static class partition_name_to_spec_args implements TBase, java.io.Serializable, Cloneable { - private static final TStruct STRUCT_DESC = new TStruct("partition_name_to_spec_args"); - private static final TField PART_NAME_FIELD_DESC = new TField("part_name", TType.STRING, (short)1); + public static class list_security_table_grant_result implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("list_security_table_grant_result"); + private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.LIST, (short)0); + private static final TField O1_FIELD_DESC = new TField("o1", TType.STRUCT, (short)1); - private String part_name; - public static final int PART_NAME = 1; + private List success; + public static final int SUCCESS = 0; + private MetaException o1; + public static final int O1 = 1; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { } public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ - put(PART_NAME, new FieldMetaData("part_name", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRING))); + put(SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, + new ListMetaData(TType.LIST, + new StructMetaData(TType.STRUCT, SecurityTablePartition.class)))); + put(O1, new FieldMetaData("o1", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRUCT))); }}); static { - FieldMetaData.addStructMetaDataMap(partition_name_to_spec_args.class, metaDataMap); + FieldMetaData.addStructMetaDataMap(list_security_table_grant_result.class, metaDataMap); } - public partition_name_to_spec_args() { + public list_security_table_grant_result() { } - public partition_name_to_spec_args( - String part_name) + public list_security_table_grant_result( + List success, + MetaException o1) { this(); - this.part_name = part_name; + this.success = success; + this.o1 = o1; } /** * Performs a deep copy on other. */ - public partition_name_to_spec_args(partition_name_to_spec_args other) { - if (other.isSetPart_name()) { - this.part_name = other.part_name; + public list_security_table_grant_result(list_security_table_grant_result other) { + if (other.isSetSuccess()) { + List __this__success = new ArrayList(); + for (SecurityTablePartition other_element : other.success) { + __this__success.add(new SecurityTablePartition(other_element)); + } + this.success = __this__success; + } + if (other.isSetO1()) { + this.o1 = new MetaException(other.o1); } } @Override - public partition_name_to_spec_args clone() { - return new partition_name_to_spec_args(this); + public list_security_table_grant_result clone() { + return new list_security_table_grant_result(this); } - public String getPart_name() { - return this.part_name; + public int getSuccessSize() { + return (this.success == null) ? 0 : this.success.size(); } - public void setPart_name(String part_name) { - this.part_name = part_name; + public java.util.Iterator getSuccessIterator() { + return (this.success == null) ? null : this.success.iterator(); } - public void unsetPart_name() { - this.part_name = null; + public void addToSuccess(SecurityTablePartition elem) { + if (this.success == null) { + this.success = new ArrayList(); + } + this.success.add(elem); } - // Returns true if field part_name is set (has been asigned a value) and false otherwise - public boolean isSetPart_name() { - return this.part_name != null; + public List getSuccess() { + return this.success; + } + + public void setSuccess(List success) { + this.success = success; + } + + public void unsetSuccess() { + this.success = null; + } + + // Returns true if field success is set (has been asigned a value) and false otherwise + public boolean isSetSuccess() { + return this.success != null; + } + + public MetaException getO1() { + return this.o1; + } + + public void setO1(MetaException o1) { + this.o1 = o1; + } + + public void unsetO1() { + this.o1 = null; + } + + // Returns true if field o1 is set (has been asigned a value) and false otherwise + public boolean isSetO1() { + return this.o1 != null; } public void setFieldValue(int fieldID, Object value) { switch (fieldID) { - case PART_NAME: + case SUCCESS: if (value == null) { - unsetPart_name(); + unsetSuccess(); } else { - setPart_name((String)value); + setSuccess((List)value); + } + break; + + case O1: + if (value == null) { + unsetO1(); + } else { + setO1((MetaException)value); } break; @@ -22381,8 +34992,11 @@ public Object getFieldValue(int fieldID) { switch (fieldID) { - case PART_NAME: - return getPart_name(); + case SUCCESS: + return getSuccess(); + + case O1: + return getO1(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); @@ -22392,8 +35006,10 @@ // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise public boolean isSet(int fieldID) { switch (fieldID) { - case PART_NAME: - return isSetPart_name(); + case SUCCESS: + return isSetSuccess(); + case O1: + return isSetO1(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -22403,21 +35019,30 @@ public boolean equals(Object that) { if (that == null) return false; - if (that instanceof partition_name_to_spec_args) - return this.equals((partition_name_to_spec_args)that); + if (that instanceof list_security_table_grant_result) + return this.equals((list_security_table_grant_result)that); return false; } - public boolean equals(partition_name_to_spec_args that) { + public boolean equals(list_security_table_grant_result that) { if (that == null) return false; - boolean this_present_part_name = true && this.isSetPart_name(); - boolean that_present_part_name = true && that.isSetPart_name(); - if (this_present_part_name || that_present_part_name) { - if (!(this_present_part_name && that_present_part_name)) + boolean this_present_success = true && this.isSetSuccess(); + boolean that_present_success = true && that.isSetSuccess(); + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (!this.success.equals(that.success)) + return false; + } + + boolean this_present_o1 = true && this.isSetO1(); + boolean that_present_o1 = true && that.isSetO1(); + if (this_present_o1 || that_present_o1) { + if (!(this_present_o1 && that_present_o1)) return false; - if (!this.part_name.equals(that.part_name)) + if (!this.o1.equals(that.o1)) return false; } @@ -22440,9 +35065,28 @@ } switch (field.id) { - case PART_NAME: - if (field.type == TType.STRING) { - this.part_name = iprot.readString(); + case SUCCESS: + if (field.type == TType.LIST) { + { + TList _list211 = iprot.readListBegin(); + this.success = new ArrayList(_list211.size); + for (int _i212 = 0; _i212 < _list211.size; ++_i212) + { + SecurityTablePartition _elem213; + _elem213 = new SecurityTablePartition(); + _elem213.read(iprot); + this.success.add(_elem213); + } + iprot.readListEnd(); + } + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case O1: + if (field.type == TType.STRUCT) { + this.o1 = new MetaException(); + this.o1.read(iprot); } else { TProtocolUtil.skip(iprot, field.type); } @@ -22459,12 +35103,21 @@ } public void write(TProtocol oprot) throws TException { - validate(); - oprot.writeStructBegin(STRUCT_DESC); - if (this.part_name != null) { - oprot.writeFieldBegin(PART_NAME_FIELD_DESC); - oprot.writeString(this.part_name); + + if (this.isSetSuccess()) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + { + oprot.writeListBegin(new TList(TType.STRUCT, this.success.size())); + for (SecurityTablePartition _iter214 : this.success) { + _iter214.write(oprot); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } else if (this.isSetO1()) { + oprot.writeFieldBegin(O1_FIELD_DESC); + this.o1.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); @@ -22473,14 +35126,22 @@ @Override public String toString() { - StringBuilder sb = new StringBuilder("partition_name_to_spec_args("); + StringBuilder sb = new StringBuilder("list_security_table_grant_result("); boolean first = true; - sb.append("part_name:"); - if (this.part_name == null) { + sb.append("success:"); + if (this.success == null) { sb.append("null"); } else { - sb.append(this.part_name); + sb.append(this.success); + } + first = false; + if (!first) sb.append(", "); + sb.append("o1:"); + if (this.o1 == null) { + sb.append("null"); + } else { + sb.append(this.o1); } first = false; sb.append(")"); @@ -22494,134 +35155,253 @@ } - public static class partition_name_to_spec_result implements TBase, java.io.Serializable, Cloneable { - private static final TStruct STRUCT_DESC = new TStruct("partition_name_to_spec_result"); - private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.MAP, (short)0); - private static final TField O1_FIELD_DESC = new TField("o1", TType.STRUCT, (short)1); + public static class list_security_partition_grant_args implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("list_security_partition_grant_args"); + private static final TField PRINCIPAL_NAME_FIELD_DESC = new TField("principal_name", TType.STRING, (short)1); + private static final TField IS_GROUP_FIELD_DESC = new TField("is_group", TType.BOOL, (short)2); + private static final TField IS_ROLE_FIELD_DESC = new TField("is_role", TType.BOOL, (short)3); + private static final TField DB_NAME_FIELD_DESC = new TField("db_name", TType.STRING, (short)4); + private static final TField TABLE_NAME_FIELD_DESC = new TField("table_name", TType.STRING, (short)5); + private static final TField PART_NAME_FIELD_DESC = new TField("part_name", TType.STRING, (short)6); - private Map success; - public static final int SUCCESS = 0; - private MetaException o1; - public static final int O1 = 1; + private String principal_name; + public static final int PRINCIPAL_NAME = 1; + private boolean is_group; + public static final int IS_GROUP = 2; + private boolean is_role; + public static final int IS_ROLE = 3; + private String db_name; + public static final int DB_NAME = 4; + private String table_name; + public static final int TABLE_NAME = 5; + private String part_name; + public static final int PART_NAME = 6; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { + public boolean is_group = false; + public boolean is_role = false; } public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ - put(SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, - new MapMetaData(TType.MAP, - new FieldValueMetaData(TType.STRING), - new FieldValueMetaData(TType.STRING)))); - put(O1, new FieldMetaData("o1", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRUCT))); + put(PRINCIPAL_NAME, new FieldMetaData("principal_name", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + put(IS_GROUP, new FieldMetaData("is_group", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.BOOL))); + put(IS_ROLE, new FieldMetaData("is_role", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.BOOL))); + put(DB_NAME, new FieldMetaData("db_name", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + put(TABLE_NAME, new FieldMetaData("table_name", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + put(PART_NAME, new FieldMetaData("part_name", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); }}); static { - FieldMetaData.addStructMetaDataMap(partition_name_to_spec_result.class, metaDataMap); + FieldMetaData.addStructMetaDataMap(list_security_partition_grant_args.class, metaDataMap); } - public partition_name_to_spec_result() { + public list_security_partition_grant_args() { } - public partition_name_to_spec_result( - Map success, - MetaException o1) + public list_security_partition_grant_args( + String principal_name, + boolean is_group, + boolean is_role, + String db_name, + String table_name, + String part_name) { this(); - this.success = success; - this.o1 = o1; + this.principal_name = principal_name; + this.is_group = is_group; + this.__isset.is_group = true; + this.is_role = is_role; + this.__isset.is_role = true; + this.db_name = db_name; + this.table_name = table_name; + this.part_name = part_name; } /** * Performs a deep copy on other. */ - public partition_name_to_spec_result(partition_name_to_spec_result other) { - if (other.isSetSuccess()) { - Map __this__success = new HashMap(); - for (Map.Entry other_element : other.success.entrySet()) { + public list_security_partition_grant_args(list_security_partition_grant_args other) { + if (other.isSetPrincipal_name()) { + this.principal_name = other.principal_name; + } + __isset.is_group = other.__isset.is_group; + this.is_group = other.is_group; + __isset.is_role = other.__isset.is_role; + this.is_role = other.is_role; + if (other.isSetDb_name()) { + this.db_name = other.db_name; + } + if (other.isSetTable_name()) { + this.table_name = other.table_name; + } + if (other.isSetPart_name()) { + this.part_name = other.part_name; + } + } - String other_element_key = other_element.getKey(); - String other_element_value = other_element.getValue(); + @Override + public list_security_partition_grant_args clone() { + return new list_security_partition_grant_args(this); + } - String __this__success_copy_key = other_element_key; + public String getPrincipal_name() { + return this.principal_name; + } - String __this__success_copy_value = other_element_value; + public void setPrincipal_name(String principal_name) { + this.principal_name = principal_name; + } - __this__success.put(__this__success_copy_key, __this__success_copy_value); - } - this.success = __this__success; - } - if (other.isSetO1()) { - this.o1 = new MetaException(other.o1); - } + public void unsetPrincipal_name() { + this.principal_name = null; } - @Override - public partition_name_to_spec_result clone() { - return new partition_name_to_spec_result(this); + // Returns true if field principal_name is set (has been asigned a value) and false otherwise + public boolean isSetPrincipal_name() { + return this.principal_name != null; } - public int getSuccessSize() { - return (this.success == null) ? 0 : this.success.size(); + public boolean isIs_group() { + return this.is_group; } - public void putToSuccess(String key, String val) { - if (this.success == null) { - this.success = new HashMap(); - } - this.success.put(key, val); + public void setIs_group(boolean is_group) { + this.is_group = is_group; + this.__isset.is_group = true; } - public Map getSuccess() { - return this.success; + public void unsetIs_group() { + this.__isset.is_group = false; + } + + // Returns true if field is_group is set (has been asigned a value) and false otherwise + public boolean isSetIs_group() { + return this.__isset.is_group; + } + + public boolean isIs_role() { + return this.is_role; + } + + public void setIs_role(boolean is_role) { + this.is_role = is_role; + this.__isset.is_role = true; + } + + public void unsetIs_role() { + this.__isset.is_role = false; + } + + // Returns true if field is_role is set (has been asigned a value) and false otherwise + public boolean isSetIs_role() { + return this.__isset.is_role; + } + + public String getDb_name() { + return this.db_name; + } + + public void setDb_name(String db_name) { + this.db_name = db_name; + } + + public void unsetDb_name() { + this.db_name = null; + } + + // Returns true if field db_name is set (has been asigned a value) and false otherwise + public boolean isSetDb_name() { + return this.db_name != null; + } + + public String getTable_name() { + return this.table_name; } - public void setSuccess(Map success) { - this.success = success; + public void setTable_name(String table_name) { + this.table_name = table_name; } - public void unsetSuccess() { - this.success = null; + public void unsetTable_name() { + this.table_name = null; } - // Returns true if field success is set (has been asigned a value) and false otherwise - public boolean isSetSuccess() { - return this.success != null; + // Returns true if field table_name is set (has been asigned a value) and false otherwise + public boolean isSetTable_name() { + return this.table_name != null; } - public MetaException getO1() { - return this.o1; + public String getPart_name() { + return this.part_name; } - public void setO1(MetaException o1) { - this.o1 = o1; + public void setPart_name(String part_name) { + this.part_name = part_name; } - public void unsetO1() { - this.o1 = null; + public void unsetPart_name() { + this.part_name = null; } - // Returns true if field o1 is set (has been asigned a value) and false otherwise - public boolean isSetO1() { - return this.o1 != null; + // Returns true if field part_name is set (has been asigned a value) and false otherwise + public boolean isSetPart_name() { + return this.part_name != null; } public void setFieldValue(int fieldID, Object value) { switch (fieldID) { - case SUCCESS: + case PRINCIPAL_NAME: if (value == null) { - unsetSuccess(); + unsetPrincipal_name(); } else { - setSuccess((Map)value); + setPrincipal_name((String)value); } break; - case O1: + case IS_GROUP: if (value == null) { - unsetO1(); + unsetIs_group(); } else { - setO1((MetaException)value); + setIs_group((Boolean)value); + } + break; + + case IS_ROLE: + if (value == null) { + unsetIs_role(); + } else { + setIs_role((Boolean)value); + } + break; + + case DB_NAME: + if (value == null) { + unsetDb_name(); + } else { + setDb_name((String)value); + } + break; + + case TABLE_NAME: + if (value == null) { + unsetTable_name(); + } else { + setTable_name((String)value); + } + break; + + case PART_NAME: + if (value == null) { + unsetPart_name(); + } else { + setPart_name((String)value); } break; @@ -22632,11 +35412,23 @@ public Object getFieldValue(int fieldID) { switch (fieldID) { - case SUCCESS: - return getSuccess(); + case PRINCIPAL_NAME: + return getPrincipal_name(); - case O1: - return getO1(); + case IS_GROUP: + return new Boolean(isIs_group()); + + case IS_ROLE: + return new Boolean(isIs_role()); + + case DB_NAME: + return getDb_name(); + + case TABLE_NAME: + return getTable_name(); + + case PART_NAME: + return getPart_name(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); @@ -22646,10 +35438,18 @@ // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise public boolean isSet(int fieldID) { switch (fieldID) { - case SUCCESS: - return isSetSuccess(); - case O1: - return isSetO1(); + case PRINCIPAL_NAME: + return isSetPrincipal_name(); + case IS_GROUP: + return isSetIs_group(); + case IS_ROLE: + return isSetIs_role(); + case DB_NAME: + return isSetDb_name(); + case TABLE_NAME: + return isSetTable_name(); + case PART_NAME: + return isSetPart_name(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -22659,30 +35459,66 @@ public boolean equals(Object that) { if (that == null) return false; - if (that instanceof partition_name_to_spec_result) - return this.equals((partition_name_to_spec_result)that); + if (that instanceof list_security_partition_grant_args) + return this.equals((list_security_partition_grant_args)that); return false; } - public boolean equals(partition_name_to_spec_result that) { + public boolean equals(list_security_partition_grant_args that) { if (that == null) return false; - boolean this_present_success = true && this.isSetSuccess(); - boolean that_present_success = true && that.isSetSuccess(); - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) + boolean this_present_principal_name = true && this.isSetPrincipal_name(); + boolean that_present_principal_name = true && that.isSetPrincipal_name(); + if (this_present_principal_name || that_present_principal_name) { + if (!(this_present_principal_name && that_present_principal_name)) return false; - if (!this.success.equals(that.success)) + if (!this.principal_name.equals(that.principal_name)) return false; } - boolean this_present_o1 = true && this.isSetO1(); - boolean that_present_o1 = true && that.isSetO1(); - if (this_present_o1 || that_present_o1) { - if (!(this_present_o1 && that_present_o1)) + boolean this_present_is_group = true; + boolean that_present_is_group = true; + if (this_present_is_group || that_present_is_group) { + if (!(this_present_is_group && that_present_is_group)) return false; - if (!this.o1.equals(that.o1)) + if (this.is_group != that.is_group) + return false; + } + + boolean this_present_is_role = true; + boolean that_present_is_role = true; + if (this_present_is_role || that_present_is_role) { + if (!(this_present_is_role && that_present_is_role)) + return false; + if (this.is_role != that.is_role) + 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) { + if (!(this_present_db_name && that_present_db_name)) + return false; + if (!this.db_name.equals(that.db_name)) + return false; + } + + boolean this_present_table_name = true && this.isSetTable_name(); + boolean that_present_table_name = true && that.isSetTable_name(); + if (this_present_table_name || that_present_table_name) { + if (!(this_present_table_name && that_present_table_name)) + return false; + if (!this.table_name.equals(that.table_name)) + return false; + } + + boolean this_present_part_name = true && this.isSetPart_name(); + boolean that_present_part_name = true && that.isSetPart_name(); + if (this_present_part_name || that_present_part_name) { + if (!(this_present_part_name && that_present_part_name)) + return false; + if (!this.part_name.equals(that.part_name)) return false; } @@ -22705,29 +35541,46 @@ } switch (field.id) { - case SUCCESS: - if (field.type == TType.MAP) { - { - TMap _map131 = iprot.readMapBegin(); - this.success = new HashMap(2*_map131.size); - for (int _i132 = 0; _i132 < _map131.size; ++_i132) - { - String _key133; - String _val134; - _key133 = iprot.readString(); - _val134 = iprot.readString(); - this.success.put(_key133, _val134); - } - iprot.readMapEnd(); - } + case PRINCIPAL_NAME: + if (field.type == TType.STRING) { + this.principal_name = iprot.readString(); } else { TProtocolUtil.skip(iprot, field.type); } break; - case O1: - if (field.type == TType.STRUCT) { - this.o1 = new MetaException(); - this.o1.read(iprot); + case IS_GROUP: + if (field.type == TType.BOOL) { + this.is_group = iprot.readBool(); + this.__isset.is_group = true; + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case IS_ROLE: + if (field.type == TType.BOOL) { + this.is_role = iprot.readBool(); + this.__isset.is_role = true; + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case DB_NAME: + if (field.type == TType.STRING) { + this.db_name = iprot.readString(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case TABLE_NAME: + if (field.type == TType.STRING) { + this.table_name = iprot.readString(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case PART_NAME: + if (field.type == TType.STRING) { + this.part_name = iprot.readString(); } else { TProtocolUtil.skip(iprot, field.type); } @@ -22744,22 +35597,33 @@ } public void write(TProtocol oprot) throws TException { - oprot.writeStructBegin(STRUCT_DESC); + validate(); - if (this.isSetSuccess()) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - { - oprot.writeMapBegin(new TMap(TType.STRING, TType.STRING, this.success.size())); - for (Map.Entry _iter135 : this.success.entrySet()) { - oprot.writeString(_iter135.getKey()); - oprot.writeString(_iter135.getValue()); - } - oprot.writeMapEnd(); - } + oprot.writeStructBegin(STRUCT_DESC); + if (this.principal_name != null) { + oprot.writeFieldBegin(PRINCIPAL_NAME_FIELD_DESC); + oprot.writeString(this.principal_name); + oprot.writeFieldEnd(); + } + oprot.writeFieldBegin(IS_GROUP_FIELD_DESC); + oprot.writeBool(this.is_group); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(IS_ROLE_FIELD_DESC); + oprot.writeBool(this.is_role); + oprot.writeFieldEnd(); + if (this.db_name != null) { + oprot.writeFieldBegin(DB_NAME_FIELD_DESC); + oprot.writeString(this.db_name); oprot.writeFieldEnd(); - } else if (this.isSetO1()) { - oprot.writeFieldBegin(O1_FIELD_DESC); - this.o1.write(oprot); + } + if (this.table_name != null) { + oprot.writeFieldBegin(TABLE_NAME_FIELD_DESC); + oprot.writeString(this.table_name); + oprot.writeFieldEnd(); + } + if (this.part_name != null) { + oprot.writeFieldBegin(PART_NAME_FIELD_DESC); + oprot.writeString(this.part_name); oprot.writeFieldEnd(); } oprot.writeFieldStop(); @@ -22768,22 +35632,46 @@ @Override public String toString() { - StringBuilder sb = new StringBuilder("partition_name_to_spec_result("); + StringBuilder sb = new StringBuilder("list_security_partition_grant_args("); boolean first = true; - sb.append("success:"); - if (this.success == null) { + sb.append("principal_name:"); + if (this.principal_name == null) { sb.append("null"); } else { - sb.append(this.success); + sb.append(this.principal_name); } first = false; if (!first) sb.append(", "); - sb.append("o1:"); - if (this.o1 == null) { + sb.append("is_group:"); + sb.append(this.is_group); + first = false; + if (!first) sb.append(", "); + sb.append("is_role:"); + sb.append(this.is_role); + first = false; + if (!first) sb.append(", "); + sb.append("db_name:"); + if (this.db_name == null) { sb.append("null"); } else { - sb.append(this.o1); + sb.append(this.db_name); + } + first = false; + if (!first) sb.append(", "); + sb.append("table_name:"); + if (this.table_name == null) { + sb.append("null"); + } else { + sb.append(this.table_name); + } + first = false; + if (!first) sb.append(", "); + sb.append("part_name:"); + if (this.part_name == null) { + sb.append("null"); + } else { + sb.append(this.part_name); } first = false; sb.append(")"); @@ -22797,109 +35685,129 @@ } - public static class add_index_args implements TBase, java.io.Serializable, Cloneable { - private static final TStruct STRUCT_DESC = new TStruct("add_index_args"); - private static final TField NEW_INDEX_FIELD_DESC = new TField("new_index", TType.STRUCT, (short)1); - private static final TField INDEX_TABLE_FIELD_DESC = new TField("index_table", TType.STRUCT, (short)2); + public static class list_security_partition_grant_result implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("list_security_partition_grant_result"); + private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.LIST, (short)0); + private static final TField O1_FIELD_DESC = new TField("o1", TType.STRUCT, (short)1); - private Index new_index; - public static final int NEW_INDEX = 1; - private Table index_table; - public static final int INDEX_TABLE = 2; + private List success; + public static final int SUCCESS = 0; + private MetaException o1; + public static final int O1 = 1; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { } public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ - put(NEW_INDEX, new FieldMetaData("new_index", TFieldRequirementType.DEFAULT, - new StructMetaData(TType.STRUCT, Index.class))); - put(INDEX_TABLE, new FieldMetaData("index_table", TFieldRequirementType.DEFAULT, - new StructMetaData(TType.STRUCT, Table.class))); + put(SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, + new ListMetaData(TType.LIST, + new StructMetaData(TType.STRUCT, SecurityTablePartition.class)))); + put(O1, new FieldMetaData("o1", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRUCT))); }}); static { - FieldMetaData.addStructMetaDataMap(add_index_args.class, metaDataMap); + FieldMetaData.addStructMetaDataMap(list_security_partition_grant_result.class, metaDataMap); } - public add_index_args() { + public list_security_partition_grant_result() { } - public add_index_args( - Index new_index, - Table index_table) + public list_security_partition_grant_result( + List success, + MetaException o1) { this(); - this.new_index = new_index; - this.index_table = index_table; + this.success = success; + this.o1 = o1; } /** * Performs a deep copy on other. */ - public add_index_args(add_index_args other) { - if (other.isSetNew_index()) { - this.new_index = new Index(other.new_index); + public list_security_partition_grant_result(list_security_partition_grant_result other) { + if (other.isSetSuccess()) { + List __this__success = new ArrayList(); + for (SecurityTablePartition other_element : other.success) { + __this__success.add(new SecurityTablePartition(other_element)); + } + this.success = __this__success; } - if (other.isSetIndex_table()) { - this.index_table = new Table(other.index_table); + if (other.isSetO1()) { + this.o1 = new MetaException(other.o1); } } @Override - public add_index_args clone() { - return new add_index_args(this); + public list_security_partition_grant_result clone() { + return new list_security_partition_grant_result(this); } - public Index getNew_index() { - return this.new_index; + public int getSuccessSize() { + return (this.success == null) ? 0 : this.success.size(); } - public void setNew_index(Index new_index) { - this.new_index = new_index; + public java.util.Iterator getSuccessIterator() { + return (this.success == null) ? null : this.success.iterator(); } - public void unsetNew_index() { - this.new_index = null; + public void addToSuccess(SecurityTablePartition elem) { + if (this.success == null) { + this.success = new ArrayList(); + } + this.success.add(elem); } - // Returns true if field new_index is set (has been asigned a value) and false otherwise - public boolean isSetNew_index() { - return this.new_index != null; + public List getSuccess() { + return this.success; } - public Table getIndex_table() { - return this.index_table; + public void setSuccess(List success) { + this.success = success; } - public void setIndex_table(Table index_table) { - this.index_table = index_table; + public void unsetSuccess() { + this.success = null; } - public void unsetIndex_table() { - this.index_table = null; + // Returns true if field success is set (has been asigned a value) and false otherwise + public boolean isSetSuccess() { + return this.success != null; } - // Returns true if field index_table is set (has been asigned a value) and false otherwise - public boolean isSetIndex_table() { - return this.index_table != null; + public MetaException getO1() { + return this.o1; + } + + public void setO1(MetaException o1) { + this.o1 = o1; + } + + public void unsetO1() { + this.o1 = null; + } + + // Returns true if field o1 is set (has been asigned a value) and false otherwise + public boolean isSetO1() { + return this.o1 != null; } public void setFieldValue(int fieldID, Object value) { switch (fieldID) { - case NEW_INDEX: + case SUCCESS: if (value == null) { - unsetNew_index(); + unsetSuccess(); } else { - setNew_index((Index)value); + setSuccess((List)value); } break; - case INDEX_TABLE: + case O1: if (value == null) { - unsetIndex_table(); + unsetO1(); } else { - setIndex_table((Table)value); + setO1((MetaException)value); } break; @@ -22910,11 +35818,11 @@ public Object getFieldValue(int fieldID) { switch (fieldID) { - case NEW_INDEX: - return getNew_index(); + case SUCCESS: + return getSuccess(); - case INDEX_TABLE: - return getIndex_table(); + case O1: + return getO1(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); @@ -22924,10 +35832,10 @@ // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise public boolean isSet(int fieldID) { switch (fieldID) { - case NEW_INDEX: - return isSetNew_index(); - case INDEX_TABLE: - return isSetIndex_table(); + case SUCCESS: + return isSetSuccess(); + case O1: + return isSetO1(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -22937,30 +35845,30 @@ public boolean equals(Object that) { if (that == null) return false; - if (that instanceof add_index_args) - return this.equals((add_index_args)that); + if (that instanceof list_security_partition_grant_result) + return this.equals((list_security_partition_grant_result)that); return false; } - public boolean equals(add_index_args that) { + public boolean equals(list_security_partition_grant_result that) { if (that == null) return false; - boolean this_present_new_index = true && this.isSetNew_index(); - boolean that_present_new_index = true && that.isSetNew_index(); - if (this_present_new_index || that_present_new_index) { - if (!(this_present_new_index && that_present_new_index)) + boolean this_present_success = true && this.isSetSuccess(); + boolean that_present_success = true && that.isSetSuccess(); + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) return false; - if (!this.new_index.equals(that.new_index)) + if (!this.success.equals(that.success)) return false; } - boolean this_present_index_table = true && this.isSetIndex_table(); - boolean that_present_index_table = true && that.isSetIndex_table(); - if (this_present_index_table || that_present_index_table) { - if (!(this_present_index_table && that_present_index_table)) + boolean this_present_o1 = true && this.isSetO1(); + boolean that_present_o1 = true && that.isSetO1(); + if (this_present_o1 || that_present_o1) { + if (!(this_present_o1 && that_present_o1)) return false; - if (!this.index_table.equals(that.index_table)) + if (!this.o1.equals(that.o1)) return false; } @@ -22983,18 +35891,28 @@ } switch (field.id) { - case NEW_INDEX: - if (field.type == TType.STRUCT) { - this.new_index = new Index(); - this.new_index.read(iprot); + case SUCCESS: + if (field.type == TType.LIST) { + { + TList _list215 = iprot.readListBegin(); + this.success = new ArrayList(_list215.size); + for (int _i216 = 0; _i216 < _list215.size; ++_i216) + { + SecurityTablePartition _elem217; + _elem217 = new SecurityTablePartition(); + _elem217.read(iprot); + this.success.add(_elem217); + } + iprot.readListEnd(); + } } else { TProtocolUtil.skip(iprot, field.type); } break; - case INDEX_TABLE: + case O1: if (field.type == TType.STRUCT) { - this.index_table = new Table(); - this.index_table.read(iprot); + this.o1 = new MetaException(); + this.o1.read(iprot); } else { TProtocolUtil.skip(iprot, field.type); } @@ -23011,17 +35929,21 @@ } public void write(TProtocol oprot) throws TException { - validate(); - oprot.writeStructBegin(STRUCT_DESC); - if (this.new_index != null) { - oprot.writeFieldBegin(NEW_INDEX_FIELD_DESC); - this.new_index.write(oprot); + + if (this.isSetSuccess()) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + { + oprot.writeListBegin(new TList(TType.STRUCT, this.success.size())); + for (SecurityTablePartition _iter218 : this.success) { + _iter218.write(oprot); + } + oprot.writeListEnd(); + } oprot.writeFieldEnd(); - } - if (this.index_table != null) { - oprot.writeFieldBegin(INDEX_TABLE_FIELD_DESC); - this.index_table.write(oprot); + } else if (this.isSetO1()) { + oprot.writeFieldBegin(O1_FIELD_DESC); + this.o1.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); @@ -23030,22 +35952,22 @@ @Override public String toString() { - StringBuilder sb = new StringBuilder("add_index_args("); + StringBuilder sb = new StringBuilder("list_security_partition_grant_result("); boolean first = true; - sb.append("new_index:"); - if (this.new_index == null) { + sb.append("success:"); + if (this.success == null) { sb.append("null"); } else { - sb.append(this.new_index); + sb.append(this.success); } first = false; if (!first) sb.append(", "); - sb.append("index_table:"); - if (this.index_table == null) { + sb.append("o1:"); + if (this.o1 == null) { sb.append("null"); } else { - sb.append(this.index_table); + sb.append(this.o1); } first = false; sb.append(")"); @@ -23059,179 +35981,253 @@ } - public static class add_index_result implements TBase, java.io.Serializable, Cloneable { - private static final TStruct STRUCT_DESC = new TStruct("add_index_result"); - private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.STRUCT, (short)0); - private static final TField O1_FIELD_DESC = new TField("o1", TType.STRUCT, (short)1); - private static final TField O2_FIELD_DESC = new TField("o2", TType.STRUCT, (short)2); - private static final TField O3_FIELD_DESC = new TField("o3", TType.STRUCT, (short)3); + public static class list_security_column_grant_args implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("list_security_column_grant_args"); + private static final TField PRINCIPAL_NAME_FIELD_DESC = new TField("principal_name", TType.STRING, (short)1); + private static final TField IS_GROUP_FIELD_DESC = new TField("is_group", TType.BOOL, (short)2); + private static final TField IS_ROLE_FIELD_DESC = new TField("is_role", TType.BOOL, (short)3); + private static final TField DB_NAME_FIELD_DESC = new TField("db_name", TType.STRING, (short)4); + private static final TField TABLE_NAME_FIELD_DESC = new TField("table_name", TType.STRING, (short)5); + private static final TField COLUMN_NAME_FIELD_DESC = new TField("column_name", TType.STRING, (short)6); - private Index success; - public static final int SUCCESS = 0; - private InvalidObjectException o1; - public static final int O1 = 1; - private AlreadyExistsException o2; - public static final int O2 = 2; - private MetaException o3; - public static final int O3 = 3; + private String principal_name; + public static final int PRINCIPAL_NAME = 1; + private boolean is_group; + public static final int IS_GROUP = 2; + private boolean is_role; + public static final int IS_ROLE = 3; + private String db_name; + public static final int DB_NAME = 4; + private String table_name; + public static final int TABLE_NAME = 5; + private String column_name; + public static final int COLUMN_NAME = 6; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { + public boolean is_group = false; + public boolean is_role = false; } public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ - put(SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, - new StructMetaData(TType.STRUCT, Index.class))); - put(O1, new FieldMetaData("o1", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRUCT))); - put(O2, new FieldMetaData("o2", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRUCT))); - put(O3, new FieldMetaData("o3", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRUCT))); + put(PRINCIPAL_NAME, new FieldMetaData("principal_name", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + put(IS_GROUP, new FieldMetaData("is_group", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.BOOL))); + put(IS_ROLE, new FieldMetaData("is_role", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.BOOL))); + put(DB_NAME, new FieldMetaData("db_name", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + put(TABLE_NAME, new FieldMetaData("table_name", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + put(COLUMN_NAME, new FieldMetaData("column_name", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); }}); static { - FieldMetaData.addStructMetaDataMap(add_index_result.class, metaDataMap); + FieldMetaData.addStructMetaDataMap(list_security_column_grant_args.class, metaDataMap); } - public add_index_result() { + public list_security_column_grant_args() { } - public add_index_result( - Index success, - InvalidObjectException o1, - AlreadyExistsException o2, - MetaException o3) + public list_security_column_grant_args( + String principal_name, + boolean is_group, + boolean is_role, + String db_name, + String table_name, + String column_name) { this(); - this.success = success; - this.o1 = o1; - this.o2 = o2; - this.o3 = o3; + this.principal_name = principal_name; + this.is_group = is_group; + this.__isset.is_group = true; + this.is_role = is_role; + this.__isset.is_role = true; + this.db_name = db_name; + this.table_name = table_name; + this.column_name = column_name; } /** * Performs a deep copy on other. */ - public add_index_result(add_index_result other) { - if (other.isSetSuccess()) { - this.success = new Index(other.success); + public list_security_column_grant_args(list_security_column_grant_args other) { + if (other.isSetPrincipal_name()) { + this.principal_name = other.principal_name; } - if (other.isSetO1()) { - this.o1 = new InvalidObjectException(other.o1); + __isset.is_group = other.__isset.is_group; + this.is_group = other.is_group; + __isset.is_role = other.__isset.is_role; + this.is_role = other.is_role; + if (other.isSetDb_name()) { + this.db_name = other.db_name; } - if (other.isSetO2()) { - this.o2 = new AlreadyExistsException(other.o2); + if (other.isSetTable_name()) { + this.table_name = other.table_name; } - if (other.isSetO3()) { - this.o3 = new MetaException(other.o3); + if (other.isSetColumn_name()) { + this.column_name = other.column_name; } } @Override - public add_index_result clone() { - return new add_index_result(this); + public list_security_column_grant_args clone() { + return new list_security_column_grant_args(this); } - public Index getSuccess() { - return this.success; + public String getPrincipal_name() { + return this.principal_name; } - public void setSuccess(Index success) { - this.success = success; + public void setPrincipal_name(String principal_name) { + this.principal_name = principal_name; } - public void unsetSuccess() { - this.success = null; + public void unsetPrincipal_name() { + this.principal_name = null; } - // Returns true if field success is set (has been asigned a value) and false otherwise - public boolean isSetSuccess() { - return this.success != null; + // Returns true if field principal_name is set (has been asigned a value) and false otherwise + public boolean isSetPrincipal_name() { + return this.principal_name != null; } - public InvalidObjectException getO1() { - return this.o1; + public boolean isIs_group() { + return this.is_group; } - public void setO1(InvalidObjectException o1) { - this.o1 = o1; + public void setIs_group(boolean is_group) { + this.is_group = is_group; + this.__isset.is_group = true; } - public void unsetO1() { - this.o1 = null; + public void unsetIs_group() { + this.__isset.is_group = false; } - // Returns true if field o1 is set (has been asigned a value) and false otherwise - public boolean isSetO1() { - return this.o1 != null; + // Returns true if field is_group is set (has been asigned a value) and false otherwise + public boolean isSetIs_group() { + return this.__isset.is_group; } - public AlreadyExistsException getO2() { - return this.o2; + public boolean isIs_role() { + return this.is_role; } - public void setO2(AlreadyExistsException o2) { - this.o2 = o2; + public void setIs_role(boolean is_role) { + this.is_role = is_role; + this.__isset.is_role = true; } - public void unsetO2() { - this.o2 = null; + public void unsetIs_role() { + this.__isset.is_role = false; } - // Returns true if field o2 is set (has been asigned a value) and false otherwise - public boolean isSetO2() { - return this.o2 != null; + // Returns true if field is_role is set (has been asigned a value) and false otherwise + public boolean isSetIs_role() { + return this.__isset.is_role; } - public MetaException getO3() { - return this.o3; + public String getDb_name() { + return this.db_name; } - public void setO3(MetaException o3) { - this.o3 = o3; + public void setDb_name(String db_name) { + this.db_name = db_name; } - public void unsetO3() { - this.o3 = null; + public void unsetDb_name() { + this.db_name = null; } - // Returns true if field o3 is set (has been asigned a value) and false otherwise - public boolean isSetO3() { - return this.o3 != null; + // Returns true if field db_name is set (has been asigned a value) and false otherwise + public boolean isSetDb_name() { + return this.db_name != null; + } + + public String getTable_name() { + return this.table_name; + } + + public void setTable_name(String table_name) { + this.table_name = table_name; + } + + public void unsetTable_name() { + this.table_name = null; + } + + // Returns true if field table_name is set (has been asigned a value) and false otherwise + public boolean isSetTable_name() { + return this.table_name != null; + } + + public String getColumn_name() { + return this.column_name; + } + + public void setColumn_name(String column_name) { + this.column_name = column_name; + } + + public void unsetColumn_name() { + this.column_name = null; + } + + // Returns true if field column_name is set (has been asigned a value) and false otherwise + public boolean isSetColumn_name() { + return this.column_name != null; } public void setFieldValue(int fieldID, Object value) { switch (fieldID) { - case SUCCESS: + case PRINCIPAL_NAME: if (value == null) { - unsetSuccess(); + unsetPrincipal_name(); } else { - setSuccess((Index)value); + setPrincipal_name((String)value); + } + break; + + case IS_GROUP: + if (value == null) { + unsetIs_group(); + } else { + setIs_group((Boolean)value); + } + break; + + case IS_ROLE: + if (value == null) { + unsetIs_role(); + } else { + setIs_role((Boolean)value); } break; - case O1: + case DB_NAME: if (value == null) { - unsetO1(); + unsetDb_name(); } else { - setO1((InvalidObjectException)value); + setDb_name((String)value); } break; - case O2: + case TABLE_NAME: if (value == null) { - unsetO2(); + unsetTable_name(); } else { - setO2((AlreadyExistsException)value); + setTable_name((String)value); } break; - case O3: + case COLUMN_NAME: if (value == null) { - unsetO3(); + unsetColumn_name(); } else { - setO3((MetaException)value); + setColumn_name((String)value); } break; @@ -23242,17 +36238,23 @@ public Object getFieldValue(int fieldID) { switch (fieldID) { - case SUCCESS: - return getSuccess(); + case PRINCIPAL_NAME: + return getPrincipal_name(); - case O1: - return getO1(); + case IS_GROUP: + return new Boolean(isIs_group()); - case O2: - return getO2(); + case IS_ROLE: + return new Boolean(isIs_role()); - case O3: - return getO3(); + case DB_NAME: + return getDb_name(); + + case TABLE_NAME: + return getTable_name(); + + case COLUMN_NAME: + return getColumn_name(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); @@ -23262,14 +36264,18 @@ // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise public boolean isSet(int fieldID) { switch (fieldID) { - case SUCCESS: - return isSetSuccess(); - case O1: - return isSetO1(); - case O2: - return isSetO2(); - case O3: - return isSetO3(); + case PRINCIPAL_NAME: + return isSetPrincipal_name(); + case IS_GROUP: + return isSetIs_group(); + case IS_ROLE: + return isSetIs_role(); + case DB_NAME: + return isSetDb_name(); + case TABLE_NAME: + return isSetTable_name(); + case COLUMN_NAME: + return isSetColumn_name(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -23279,48 +36285,66 @@ public boolean equals(Object that) { if (that == null) return false; - if (that instanceof add_index_result) - return this.equals((add_index_result)that); + if (that instanceof list_security_column_grant_args) + return this.equals((list_security_column_grant_args)that); return false; } - public boolean equals(add_index_result that) { + public boolean equals(list_security_column_grant_args that) { if (that == null) return false; - boolean this_present_success = true && this.isSetSuccess(); - boolean that_present_success = true && that.isSetSuccess(); - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) + boolean this_present_principal_name = true && this.isSetPrincipal_name(); + boolean that_present_principal_name = true && that.isSetPrincipal_name(); + if (this_present_principal_name || that_present_principal_name) { + if (!(this_present_principal_name && that_present_principal_name)) return false; - if (!this.success.equals(that.success)) + if (!this.principal_name.equals(that.principal_name)) return false; } - boolean this_present_o1 = true && this.isSetO1(); - boolean that_present_o1 = true && that.isSetO1(); - if (this_present_o1 || that_present_o1) { - if (!(this_present_o1 && that_present_o1)) + boolean this_present_is_group = true; + boolean that_present_is_group = true; + if (this_present_is_group || that_present_is_group) { + if (!(this_present_is_group && that_present_is_group)) return false; - if (!this.o1.equals(that.o1)) + if (this.is_group != that.is_group) return false; } - boolean this_present_o2 = true && this.isSetO2(); - boolean that_present_o2 = true && that.isSetO2(); - if (this_present_o2 || that_present_o2) { - if (!(this_present_o2 && that_present_o2)) + boolean this_present_is_role = true; + boolean that_present_is_role = true; + if (this_present_is_role || that_present_is_role) { + if (!(this_present_is_role && that_present_is_role)) return false; - if (!this.o2.equals(that.o2)) + if (this.is_role != that.is_role) return false; } - boolean this_present_o3 = true && this.isSetO3(); - boolean that_present_o3 = true && that.isSetO3(); - if (this_present_o3 || that_present_o3) { - if (!(this_present_o3 && that_present_o3)) + 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) { + if (!(this_present_db_name && that_present_db_name)) return false; - if (!this.o3.equals(that.o3)) + if (!this.db_name.equals(that.db_name)) + return false; + } + + boolean this_present_table_name = true && this.isSetTable_name(); + boolean that_present_table_name = true && that.isSetTable_name(); + if (this_present_table_name || that_present_table_name) { + if (!(this_present_table_name && that_present_table_name)) + return false; + if (!this.table_name.equals(that.table_name)) + return false; + } + + boolean this_present_column_name = true && this.isSetColumn_name(); + boolean that_present_column_name = true && that.isSetColumn_name(); + if (this_present_column_name || that_present_column_name) { + if (!(this_present_column_name && that_present_column_name)) + return false; + if (!this.column_name.equals(that.column_name)) return false; } @@ -23343,34 +36367,46 @@ } switch (field.id) { - case SUCCESS: - if (field.type == TType.STRUCT) { - this.success = new Index(); - this.success.read(iprot); + case PRINCIPAL_NAME: + if (field.type == TType.STRING) { + this.principal_name = iprot.readString(); } else { TProtocolUtil.skip(iprot, field.type); } break; - case O1: - if (field.type == TType.STRUCT) { - this.o1 = new InvalidObjectException(); - this.o1.read(iprot); + case IS_GROUP: + if (field.type == TType.BOOL) { + this.is_group = iprot.readBool(); + this.__isset.is_group = true; } else { TProtocolUtil.skip(iprot, field.type); } break; - case O2: - if (field.type == TType.STRUCT) { - this.o2 = new AlreadyExistsException(); - this.o2.read(iprot); + case IS_ROLE: + if (field.type == TType.BOOL) { + this.is_role = iprot.readBool(); + this.__isset.is_role = true; } else { TProtocolUtil.skip(iprot, field.type); } break; - case O3: - if (field.type == TType.STRUCT) { - this.o3 = new MetaException(); - this.o3.read(iprot); + case DB_NAME: + if (field.type == TType.STRING) { + this.db_name = iprot.readString(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case TABLE_NAME: + if (field.type == TType.STRING) { + this.table_name = iprot.readString(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case COLUMN_NAME: + if (field.type == TType.STRING) { + this.column_name = iprot.readString(); } else { TProtocolUtil.skip(iprot, field.type); } @@ -23387,23 +36423,33 @@ } public void write(TProtocol oprot) throws TException { - oprot.writeStructBegin(STRUCT_DESC); + validate(); - if (this.isSetSuccess()) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - this.success.write(oprot); + oprot.writeStructBegin(STRUCT_DESC); + if (this.principal_name != null) { + oprot.writeFieldBegin(PRINCIPAL_NAME_FIELD_DESC); + oprot.writeString(this.principal_name); oprot.writeFieldEnd(); - } else if (this.isSetO1()) { - oprot.writeFieldBegin(O1_FIELD_DESC); - this.o1.write(oprot); + } + oprot.writeFieldBegin(IS_GROUP_FIELD_DESC); + oprot.writeBool(this.is_group); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(IS_ROLE_FIELD_DESC); + oprot.writeBool(this.is_role); + oprot.writeFieldEnd(); + if (this.db_name != null) { + oprot.writeFieldBegin(DB_NAME_FIELD_DESC); + oprot.writeString(this.db_name); oprot.writeFieldEnd(); - } else if (this.isSetO2()) { - oprot.writeFieldBegin(O2_FIELD_DESC); - this.o2.write(oprot); + } + if (this.table_name != null) { + oprot.writeFieldBegin(TABLE_NAME_FIELD_DESC); + oprot.writeString(this.table_name); oprot.writeFieldEnd(); - } else if (this.isSetO3()) { - oprot.writeFieldBegin(O3_FIELD_DESC); - this.o3.write(oprot); + } + if (this.column_name != null) { + oprot.writeFieldBegin(COLUMN_NAME_FIELD_DESC); + oprot.writeString(this.column_name); oprot.writeFieldEnd(); } oprot.writeFieldStop(); @@ -23412,38 +36458,46 @@ @Override public String toString() { - StringBuilder sb = new StringBuilder("add_index_result("); + StringBuilder sb = new StringBuilder("list_security_column_grant_args("); boolean first = true; - sb.append("success:"); - if (this.success == null) { + sb.append("principal_name:"); + if (this.principal_name == null) { sb.append("null"); } else { - sb.append(this.success); + sb.append(this.principal_name); } first = false; if (!first) sb.append(", "); - sb.append("o1:"); - if (this.o1 == null) { + sb.append("is_group:"); + sb.append(this.is_group); + first = false; + if (!first) sb.append(", "); + sb.append("is_role:"); + sb.append(this.is_role); + first = false; + if (!first) sb.append(", "); + sb.append("db_name:"); + if (this.db_name == null) { sb.append("null"); } else { - sb.append(this.o1); + sb.append(this.db_name); } first = false; if (!first) sb.append(", "); - sb.append("o2:"); - if (this.o2 == null) { + sb.append("table_name:"); + if (this.table_name == null) { sb.append("null"); } else { - sb.append(this.o2); + sb.append(this.table_name); } first = false; if (!first) sb.append(", "); - sb.append("o3:"); - if (this.o3 == null) { + sb.append("column_name:"); + if (this.column_name == null) { sb.append("null"); } else { - sb.append(this.o3); + sb.append(this.column_name); } first = false; sb.append(")"); @@ -23457,181 +36511,129 @@ } - public static class drop_index_by_name_args implements TBase, java.io.Serializable, Cloneable { - private static final TStruct STRUCT_DESC = new TStruct("drop_index_by_name_args"); - private static final TField DB_NAME_FIELD_DESC = new TField("db_name", TType.STRING, (short)1); - private static final TField TBL_NAME_FIELD_DESC = new TField("tbl_name", TType.STRING, (short)2); - private static final TField INDEX_NAME_FIELD_DESC = new TField("index_name", TType.STRING, (short)3); - private static final TField DELETE_DATA_FIELD_DESC = new TField("deleteData", TType.BOOL, (short)4); + public static class list_security_column_grant_result implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("list_security_column_grant_result"); + private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.LIST, (short)0); + private static final TField O1_FIELD_DESC = new TField("o1", TType.STRUCT, (short)1); - private String db_name; - public static final int DB_NAME = 1; - private String tbl_name; - public static final int TBL_NAME = 2; - private String index_name; - public static final int INDEX_NAME = 3; - private boolean deleteData; - public static final int DELETEDATA = 4; + private List success; + public static final int SUCCESS = 0; + private MetaException o1; + public static final int O1 = 1; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { - public boolean deleteData = false; } public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ - put(DB_NAME, new FieldMetaData("db_name", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRING))); - put(TBL_NAME, new FieldMetaData("tbl_name", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRING))); - put(INDEX_NAME, new FieldMetaData("index_name", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRING))); - put(DELETEDATA, new FieldMetaData("deleteData", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.BOOL))); + put(SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, + new ListMetaData(TType.LIST, + new StructMetaData(TType.STRUCT, SecurityColumn.class)))); + put(O1, new FieldMetaData("o1", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRUCT))); }}); static { - FieldMetaData.addStructMetaDataMap(drop_index_by_name_args.class, metaDataMap); + FieldMetaData.addStructMetaDataMap(list_security_column_grant_result.class, metaDataMap); } - public drop_index_by_name_args() { + public list_security_column_grant_result() { } - public drop_index_by_name_args( - String db_name, - String tbl_name, - String index_name, - boolean deleteData) + public list_security_column_grant_result( + List success, + MetaException o1) { this(); - this.db_name = db_name; - this.tbl_name = tbl_name; - this.index_name = index_name; - this.deleteData = deleteData; - this.__isset.deleteData = true; + this.success = success; + this.o1 = o1; } /** * Performs a deep copy on other. */ - public drop_index_by_name_args(drop_index_by_name_args other) { - if (other.isSetDb_name()) { - this.db_name = other.db_name; - } - if (other.isSetTbl_name()) { - this.tbl_name = other.tbl_name; + public list_security_column_grant_result(list_security_column_grant_result other) { + if (other.isSetSuccess()) { + List __this__success = new ArrayList(); + for (SecurityColumn other_element : other.success) { + __this__success.add(new SecurityColumn(other_element)); + } + this.success = __this__success; } - if (other.isSetIndex_name()) { - this.index_name = other.index_name; + if (other.isSetO1()) { + this.o1 = new MetaException(other.o1); } - __isset.deleteData = other.__isset.deleteData; - this.deleteData = other.deleteData; } @Override - public drop_index_by_name_args clone() { - return new drop_index_by_name_args(this); - } - - public String getDb_name() { - return this.db_name; - } - - public void setDb_name(String db_name) { - this.db_name = db_name; - } - - public void unsetDb_name() { - this.db_name = null; - } - - // Returns true if field db_name is set (has been asigned a value) and false otherwise - public boolean isSetDb_name() { - return this.db_name != null; - } - - public String getTbl_name() { - return this.tbl_name; + public list_security_column_grant_result clone() { + return new list_security_column_grant_result(this); } - public void setTbl_name(String tbl_name) { - this.tbl_name = tbl_name; + public int getSuccessSize() { + return (this.success == null) ? 0 : this.success.size(); } - public void unsetTbl_name() { - this.tbl_name = null; + public java.util.Iterator getSuccessIterator() { + return (this.success == null) ? null : this.success.iterator(); } - // Returns true if field tbl_name is set (has been asigned a value) and false otherwise - public boolean isSetTbl_name() { - return this.tbl_name != null; + public void addToSuccess(SecurityColumn elem) { + if (this.success == null) { + this.success = new ArrayList(); + } + this.success.add(elem); } - public String getIndex_name() { - return this.index_name; + public List getSuccess() { + return this.success; } - public void setIndex_name(String index_name) { - this.index_name = index_name; + public void setSuccess(List success) { + this.success = success; } - public void unsetIndex_name() { - this.index_name = null; + public void unsetSuccess() { + this.success = null; } - // Returns true if field index_name is set (has been asigned a value) and false otherwise - public boolean isSetIndex_name() { - return this.index_name != null; + // Returns true if field success is set (has been asigned a value) and false otherwise + public boolean isSetSuccess() { + return this.success != null; } - public boolean isDeleteData() { - return this.deleteData; + public MetaException getO1() { + return this.o1; } - public void setDeleteData(boolean deleteData) { - this.deleteData = deleteData; - this.__isset.deleteData = true; + public void setO1(MetaException o1) { + this.o1 = o1; } - public void unsetDeleteData() { - this.__isset.deleteData = false; + public void unsetO1() { + this.o1 = null; } - // Returns true if field deleteData is set (has been asigned a value) and false otherwise - public boolean isSetDeleteData() { - return this.__isset.deleteData; + // Returns true if field o1 is set (has been asigned a value) and false otherwise + public boolean isSetO1() { + return this.o1 != null; } public void setFieldValue(int fieldID, Object value) { switch (fieldID) { - case DB_NAME: - if (value == null) { - unsetDb_name(); - } else { - setDb_name((String)value); - } - break; - - case TBL_NAME: - if (value == null) { - unsetTbl_name(); - } else { - setTbl_name((String)value); - } - break; - - case INDEX_NAME: + case SUCCESS: if (value == null) { - unsetIndex_name(); + unsetSuccess(); } else { - setIndex_name((String)value); + setSuccess((List)value); } break; - case DELETEDATA: + case O1: if (value == null) { - unsetDeleteData(); + unsetO1(); } else { - setDeleteData((Boolean)value); + setO1((MetaException)value); } break; @@ -23642,17 +36644,11 @@ public Object getFieldValue(int fieldID) { switch (fieldID) { - case DB_NAME: - return getDb_name(); - - case TBL_NAME: - return getTbl_name(); - - case INDEX_NAME: - return getIndex_name(); + case SUCCESS: + return getSuccess(); - case DELETEDATA: - return new Boolean(isDeleteData()); + case O1: + return getO1(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); @@ -23662,14 +36658,10 @@ // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise public boolean isSet(int fieldID) { switch (fieldID) { - case DB_NAME: - return isSetDb_name(); - case TBL_NAME: - return isSetTbl_name(); - case INDEX_NAME: - return isSetIndex_name(); - case DELETEDATA: - return isSetDeleteData(); + case SUCCESS: + return isSetSuccess(); + case O1: + return isSetO1(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -23679,48 +36671,30 @@ public boolean equals(Object that) { if (that == null) return false; - if (that instanceof drop_index_by_name_args) - return this.equals((drop_index_by_name_args)that); + if (that instanceof list_security_column_grant_result) + return this.equals((list_security_column_grant_result)that); return false; } - public boolean equals(drop_index_by_name_args that) { + public boolean equals(list_security_column_grant_result that) { if (that == null) 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) { - if (!(this_present_db_name && that_present_db_name)) - return false; - if (!this.db_name.equals(that.db_name)) - return false; - } - - boolean this_present_tbl_name = true && this.isSetTbl_name(); - boolean that_present_tbl_name = true && that.isSetTbl_name(); - if (this_present_tbl_name || that_present_tbl_name) { - if (!(this_present_tbl_name && that_present_tbl_name)) - return false; - if (!this.tbl_name.equals(that.tbl_name)) - return false; - } - - boolean this_present_index_name = true && this.isSetIndex_name(); - boolean that_present_index_name = true && that.isSetIndex_name(); - if (this_present_index_name || that_present_index_name) { - if (!(this_present_index_name && that_present_index_name)) + boolean this_present_success = true && this.isSetSuccess(); + boolean that_present_success = true && that.isSetSuccess(); + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) return false; - if (!this.index_name.equals(that.index_name)) + if (!this.success.equals(that.success)) return false; } - boolean this_present_deleteData = true; - boolean that_present_deleteData = true; - if (this_present_deleteData || that_present_deleteData) { - if (!(this_present_deleteData && that_present_deleteData)) + boolean this_present_o1 = true && this.isSetO1(); + boolean that_present_o1 = true && that.isSetO1(); + if (this_present_o1 || that_present_o1) { + if (!(this_present_o1 && that_present_o1)) return false; - if (this.deleteData != that.deleteData) + if (!this.o1.equals(that.o1)) return false; } @@ -23736,38 +36710,35 @@ TField field; iprot.readStructBegin(); while (true) - { - field = iprot.readFieldBegin(); - if (field.type == TType.STOP) { - break; - } - switch (field.id) - { - case DB_NAME: - if (field.type == TType.STRING) { - this.db_name = iprot.readString(); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - case TBL_NAME: - if (field.type == TType.STRING) { - this.tbl_name = iprot.readString(); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - case INDEX_NAME: - if (field.type == TType.STRING) { - this.index_name = iprot.readString(); + { + field = iprot.readFieldBegin(); + if (field.type == TType.STOP) { + break; + } + switch (field.id) + { + case SUCCESS: + if (field.type == TType.LIST) { + { + TList _list219 = iprot.readListBegin(); + this.success = new ArrayList(_list219.size); + for (int _i220 = 0; _i220 < _list219.size; ++_i220) + { + SecurityColumn _elem221; + _elem221 = new SecurityColumn(); + _elem221.read(iprot); + this.success.add(_elem221); + } + iprot.readListEnd(); + } } else { TProtocolUtil.skip(iprot, field.type); } break; - case DELETEDATA: - if (field.type == TType.BOOL) { - this.deleteData = iprot.readBool(); - this.__isset.deleteData = true; + case O1: + if (field.type == TType.STRUCT) { + this.o1 = new MetaException(); + this.o1.read(iprot); } else { TProtocolUtil.skip(iprot, field.type); } @@ -23784,63 +36755,47 @@ } public void write(TProtocol oprot) throws TException { - validate(); - oprot.writeStructBegin(STRUCT_DESC); - if (this.db_name != null) { - oprot.writeFieldBegin(DB_NAME_FIELD_DESC); - oprot.writeString(this.db_name); - oprot.writeFieldEnd(); - } - if (this.tbl_name != null) { - oprot.writeFieldBegin(TBL_NAME_FIELD_DESC); - oprot.writeString(this.tbl_name); + + if (this.isSetSuccess()) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + { + oprot.writeListBegin(new TList(TType.STRUCT, this.success.size())); + for (SecurityColumn _iter222 : this.success) { + _iter222.write(oprot); + } + oprot.writeListEnd(); + } oprot.writeFieldEnd(); - } - if (this.index_name != null) { - oprot.writeFieldBegin(INDEX_NAME_FIELD_DESC); - oprot.writeString(this.index_name); + } else if (this.isSetO1()) { + oprot.writeFieldBegin(O1_FIELD_DESC); + this.o1.write(oprot); oprot.writeFieldEnd(); } - oprot.writeFieldBegin(DELETE_DATA_FIELD_DESC); - oprot.writeBool(this.deleteData); - oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } @Override public String toString() { - StringBuilder sb = new StringBuilder("drop_index_by_name_args("); + StringBuilder sb = new StringBuilder("list_security_column_grant_result("); boolean first = true; - sb.append("db_name:"); - if (this.db_name == null) { - sb.append("null"); - } else { - sb.append(this.db_name); - } - first = false; - if (!first) sb.append(", "); - sb.append("tbl_name:"); - if (this.tbl_name == null) { + sb.append("success:"); + if (this.success == null) { sb.append("null"); } else { - sb.append(this.tbl_name); + sb.append(this.success); } first = false; if (!first) sb.append(", "); - sb.append("index_name:"); - if (this.index_name == null) { + sb.append("o1:"); + if (this.o1 == null) { sb.append("null"); } else { - sb.append(this.index_name); + sb.append(this.o1); } first = false; - if (!first) sb.append(", "); - sb.append("deleteData:"); - sb.append(this.deleteData); - first = false; sb.append(")"); return sb.toString(); } @@ -23852,146 +36807,218 @@ } - public static class drop_index_by_name_result implements TBase, java.io.Serializable, Cloneable { - private static final TStruct STRUCT_DESC = new TStruct("drop_index_by_name_result"); - private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.BOOL, (short)0); - private static final TField O1_FIELD_DESC = new TField("o1", TType.STRUCT, (short)1); - private static final TField O2_FIELD_DESC = new TField("o2", TType.STRUCT, (short)2); + public static class grant_privileges_args implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("grant_privileges_args"); + private static final TField USER_NAME_FIELD_DESC = new TField("user_name", TType.STRING, (short)1); + private static final TField IS_ROLE_FIELD_DESC = new TField("is_role", TType.BOOL, (short)2); + private static final TField IS_GROUP_FIELD_DESC = new TField("is_group", TType.BOOL, (short)3); + private static final TField PRIVILEGES_FIELD_DESC = new TField("privileges", TType.STRUCT, (short)4); + private static final TField GRANTOR_FIELD_DESC = new TField("grantor", TType.STRING, (short)5); - private boolean success; - public static final int SUCCESS = 0; - private NoSuchObjectException o1; - public static final int O1 = 1; - private MetaException o2; - public static final int O2 = 2; + private String user_name; + public static final int USER_NAME = 1; + private boolean is_role; + public static final int IS_ROLE = 2; + private boolean is_group; + public static final int IS_GROUP = 3; + private PrivilegeBag privileges; + public static final int PRIVILEGES = 4; + private String grantor; + public static final int GRANTOR = 5; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { - public boolean success = false; + public boolean is_role = false; + public boolean is_group = false; } public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ - put(SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, + put(USER_NAME, new FieldMetaData("user_name", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + put(IS_ROLE, new FieldMetaData("is_role", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.BOOL))); - put(O1, new FieldMetaData("o1", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRUCT))); - put(O2, new FieldMetaData("o2", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRUCT))); + put(IS_GROUP, new FieldMetaData("is_group", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.BOOL))); + put(PRIVILEGES, new FieldMetaData("privileges", TFieldRequirementType.DEFAULT, + new StructMetaData(TType.STRUCT, PrivilegeBag.class))); + put(GRANTOR, new FieldMetaData("grantor", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); }}); static { - FieldMetaData.addStructMetaDataMap(drop_index_by_name_result.class, metaDataMap); + FieldMetaData.addStructMetaDataMap(grant_privileges_args.class, metaDataMap); } - public drop_index_by_name_result() { + public grant_privileges_args() { } - public drop_index_by_name_result( - boolean success, - NoSuchObjectException o1, - MetaException o2) + public grant_privileges_args( + String user_name, + boolean is_role, + boolean is_group, + PrivilegeBag privileges, + String grantor) { this(); - this.success = success; - this.__isset.success = true; - this.o1 = o1; - this.o2 = o2; + this.user_name = user_name; + this.is_role = is_role; + this.__isset.is_role = true; + this.is_group = is_group; + this.__isset.is_group = true; + this.privileges = privileges; + this.grantor = grantor; } /** * Performs a deep copy on other. */ - public drop_index_by_name_result(drop_index_by_name_result other) { - __isset.success = other.__isset.success; - this.success = other.success; - if (other.isSetO1()) { - this.o1 = new NoSuchObjectException(other.o1); + public grant_privileges_args(grant_privileges_args other) { + if (other.isSetUser_name()) { + this.user_name = other.user_name; } - if (other.isSetO2()) { - this.o2 = new MetaException(other.o2); + __isset.is_role = other.__isset.is_role; + this.is_role = other.is_role; + __isset.is_group = other.__isset.is_group; + this.is_group = other.is_group; + if (other.isSetPrivileges()) { + this.privileges = new PrivilegeBag(other.privileges); + } + if (other.isSetGrantor()) { + this.grantor = other.grantor; } } @Override - public drop_index_by_name_result clone() { - return new drop_index_by_name_result(this); + public grant_privileges_args clone() { + return new grant_privileges_args(this); } - public boolean isSuccess() { - return this.success; + public String getUser_name() { + return this.user_name; } - public void setSuccess(boolean success) { - this.success = success; - this.__isset.success = true; + public void setUser_name(String user_name) { + this.user_name = user_name; } - public void unsetSuccess() { - this.__isset.success = false; + public void unsetUser_name() { + this.user_name = null; } - // Returns true if field success is set (has been asigned a value) and false otherwise - public boolean isSetSuccess() { - return this.__isset.success; + // Returns true if field user_name is set (has been asigned a value) and false otherwise + public boolean isSetUser_name() { + return this.user_name != null; } - public NoSuchObjectException getO1() { - return this.o1; + public boolean isIs_role() { + return this.is_role; } - public void setO1(NoSuchObjectException o1) { - this.o1 = o1; + public void setIs_role(boolean is_role) { + this.is_role = is_role; + this.__isset.is_role = true; } - public void unsetO1() { - this.o1 = null; + public void unsetIs_role() { + this.__isset.is_role = false; } - // Returns true if field o1 is set (has been asigned a value) and false otherwise - public boolean isSetO1() { - return this.o1 != null; + // Returns true if field is_role is set (has been asigned a value) and false otherwise + public boolean isSetIs_role() { + return this.__isset.is_role; } - public MetaException getO2() { - return this.o2; + public boolean isIs_group() { + return this.is_group; } - public void setO2(MetaException o2) { - this.o2 = o2; + public void setIs_group(boolean is_group) { + this.is_group = is_group; + this.__isset.is_group = true; + } + + public void unsetIs_group() { + this.__isset.is_group = false; + } + + // Returns true if field is_group is set (has been asigned a value) and false otherwise + public boolean isSetIs_group() { + return this.__isset.is_group; + } + + public PrivilegeBag getPrivileges() { + return this.privileges; + } + + public void setPrivileges(PrivilegeBag privileges) { + this.privileges = privileges; + } + + public void unsetPrivileges() { + this.privileges = null; + } + + // Returns true if field privileges is set (has been asigned a value) and false otherwise + public boolean isSetPrivileges() { + return this.privileges != null; + } + + public String getGrantor() { + return this.grantor; + } + + public void setGrantor(String grantor) { + this.grantor = grantor; } - public void unsetO2() { - this.o2 = null; + public void unsetGrantor() { + this.grantor = null; } - // Returns true if field o2 is set (has been asigned a value) and false otherwise - public boolean isSetO2() { - return this.o2 != null; + // Returns true if field grantor is set (has been asigned a value) and false otherwise + public boolean isSetGrantor() { + return this.grantor != null; } public void setFieldValue(int fieldID, Object value) { switch (fieldID) { - case SUCCESS: + case USER_NAME: if (value == null) { - unsetSuccess(); + unsetUser_name(); } else { - setSuccess((Boolean)value); + setUser_name((String)value); } break; - case O1: + case IS_ROLE: if (value == null) { - unsetO1(); + unsetIs_role(); } else { - setO1((NoSuchObjectException)value); + setIs_role((Boolean)value); } break; - case O2: + case IS_GROUP: if (value == null) { - unsetO2(); + unsetIs_group(); } else { - setO2((MetaException)value); + setIs_group((Boolean)value); + } + break; + + case PRIVILEGES: + if (value == null) { + unsetPrivileges(); + } else { + setPrivileges((PrivilegeBag)value); + } + break; + + case GRANTOR: + if (value == null) { + unsetGrantor(); + } else { + setGrantor((String)value); } break; @@ -24002,14 +37029,20 @@ public Object getFieldValue(int fieldID) { switch (fieldID) { - case SUCCESS: - return new Boolean(isSuccess()); + case USER_NAME: + return getUser_name(); - case O1: - return getO1(); + case IS_ROLE: + return new Boolean(isIs_role()); - case O2: - return getO2(); + case IS_GROUP: + return new Boolean(isIs_group()); + + case PRIVILEGES: + return getPrivileges(); + + case GRANTOR: + return getGrantor(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); @@ -24019,12 +37052,16 @@ // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise public boolean isSet(int fieldID) { switch (fieldID) { - case SUCCESS: - return isSetSuccess(); - case O1: - return isSetO1(); - case O2: - return isSetO2(); + case USER_NAME: + return isSetUser_name(); + case IS_ROLE: + return isSetIs_role(); + case IS_GROUP: + return isSetIs_group(); + case PRIVILEGES: + return isSetPrivileges(); + case GRANTOR: + return isSetGrantor(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -24034,39 +37071,57 @@ public boolean equals(Object that) { if (that == null) return false; - if (that instanceof drop_index_by_name_result) - return this.equals((drop_index_by_name_result)that); + if (that instanceof grant_privileges_args) + return this.equals((grant_privileges_args)that); return false; } - public boolean equals(drop_index_by_name_result that) { + public boolean equals(grant_privileges_args that) { if (that == null) return false; - boolean this_present_success = true; - boolean that_present_success = true; - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) + boolean this_present_user_name = true && this.isSetUser_name(); + boolean that_present_user_name = true && that.isSetUser_name(); + if (this_present_user_name || that_present_user_name) { + if (!(this_present_user_name && that_present_user_name)) return false; - if (this.success != that.success) + if (!this.user_name.equals(that.user_name)) return false; } - boolean this_present_o1 = true && this.isSetO1(); - boolean that_present_o1 = true && that.isSetO1(); - if (this_present_o1 || that_present_o1) { - if (!(this_present_o1 && that_present_o1)) + boolean this_present_is_role = true; + boolean that_present_is_role = true; + if (this_present_is_role || that_present_is_role) { + if (!(this_present_is_role && that_present_is_role)) return false; - if (!this.o1.equals(that.o1)) + if (this.is_role != that.is_role) return false; } - boolean this_present_o2 = true && this.isSetO2(); - boolean that_present_o2 = true && that.isSetO2(); - if (this_present_o2 || that_present_o2) { - if (!(this_present_o2 && that_present_o2)) + boolean this_present_is_group = true; + boolean that_present_is_group = true; + if (this_present_is_group || that_present_is_group) { + if (!(this_present_is_group && that_present_is_group)) return false; - if (!this.o2.equals(that.o2)) + if (this.is_group != that.is_group) + return false; + } + + boolean this_present_privileges = true && this.isSetPrivileges(); + boolean that_present_privileges = true && that.isSetPrivileges(); + if (this_present_privileges || that_present_privileges) { + if (!(this_present_privileges && that_present_privileges)) + return false; + if (!this.privileges.equals(that.privileges)) + return false; + } + + boolean this_present_grantor = true && this.isSetGrantor(); + boolean that_present_grantor = true && that.isSetGrantor(); + if (this_present_grantor || that_present_grantor) { + if (!(this_present_grantor && that_present_grantor)) + return false; + if (!this.grantor.equals(that.grantor)) return false; } @@ -24089,26 +37144,40 @@ } switch (field.id) { - case SUCCESS: + case USER_NAME: + if (field.type == TType.STRING) { + this.user_name = iprot.readString(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case IS_ROLE: if (field.type == TType.BOOL) { - this.success = iprot.readBool(); - this.__isset.success = true; + this.is_role = iprot.readBool(); + this.__isset.is_role = true; } else { TProtocolUtil.skip(iprot, field.type); } break; - case O1: - if (field.type == TType.STRUCT) { - this.o1 = new NoSuchObjectException(); - this.o1.read(iprot); + case IS_GROUP: + if (field.type == TType.BOOL) { + this.is_group = iprot.readBool(); + this.__isset.is_group = true; } else { TProtocolUtil.skip(iprot, field.type); } break; - case O2: + case PRIVILEGES: if (field.type == TType.STRUCT) { - this.o2 = new MetaException(); - this.o2.read(iprot); + this.privileges = new PrivilegeBag(); + this.privileges.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case GRANTOR: + if (field.type == TType.STRING) { + this.grantor = iprot.readString(); } else { TProtocolUtil.skip(iprot, field.type); } @@ -24125,19 +37194,28 @@ } public void write(TProtocol oprot) throws TException { - oprot.writeStructBegin(STRUCT_DESC); + validate(); - if (this.isSetSuccess()) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - oprot.writeBool(this.success); + oprot.writeStructBegin(STRUCT_DESC); + if (this.user_name != null) { + oprot.writeFieldBegin(USER_NAME_FIELD_DESC); + oprot.writeString(this.user_name); oprot.writeFieldEnd(); - } else if (this.isSetO1()) { - oprot.writeFieldBegin(O1_FIELD_DESC); - this.o1.write(oprot); + } + oprot.writeFieldBegin(IS_ROLE_FIELD_DESC); + oprot.writeBool(this.is_role); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(IS_GROUP_FIELD_DESC); + oprot.writeBool(this.is_group); + oprot.writeFieldEnd(); + if (this.privileges != null) { + oprot.writeFieldBegin(PRIVILEGES_FIELD_DESC); + this.privileges.write(oprot); oprot.writeFieldEnd(); - } else if (this.isSetO2()) { - oprot.writeFieldBegin(O2_FIELD_DESC); - this.o2.write(oprot); + } + if (this.grantor != null) { + oprot.writeFieldBegin(GRANTOR_FIELD_DESC); + oprot.writeString(this.grantor); oprot.writeFieldEnd(); } oprot.writeFieldStop(); @@ -24146,26 +37224,38 @@ @Override public String toString() { - StringBuilder sb = new StringBuilder("drop_index_by_name_result("); + StringBuilder sb = new StringBuilder("grant_privileges_args("); boolean first = true; - sb.append("success:"); - sb.append(this.success); + sb.append("user_name:"); + if (this.user_name == null) { + sb.append("null"); + } else { + sb.append(this.user_name); + } first = false; if (!first) sb.append(", "); - sb.append("o1:"); - if (this.o1 == null) { + sb.append("is_role:"); + sb.append(this.is_role); + first = false; + if (!first) sb.append(", "); + sb.append("is_group:"); + sb.append(this.is_group); + first = false; + if (!first) sb.append(", "); + sb.append("privileges:"); + if (this.privileges == null) { sb.append("null"); } else { - sb.append(this.o1); + sb.append(this.privileges); } first = false; if (!first) sb.append(", "); - sb.append("o2:"); - if (this.o2 == null) { + sb.append("grantor:"); + if (this.grantor == null) { sb.append("null"); } else { - sb.append(this.o2); + sb.append(this.grantor); } first = false; sb.append(")"); @@ -24179,144 +37269,111 @@ } - public static class get_index_by_name_args implements TBase, java.io.Serializable, Cloneable { - private static final TStruct STRUCT_DESC = new TStruct("get_index_by_name_args"); - private static final TField DB_NAME_FIELD_DESC = new TField("db_name", TType.STRING, (short)1); - private static final TField TBL_NAME_FIELD_DESC = new TField("tbl_name", TType.STRING, (short)2); - private static final TField INDEX_NAME_FIELD_DESC = new TField("index_name", TType.STRING, (short)3); + public static class grant_privileges_result implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("grant_privileges_result"); + private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.BOOL, (short)0); + private static final TField O1_FIELD_DESC = new TField("o1", TType.STRUCT, (short)1); - private String db_name; - public static final int DB_NAME = 1; - private String tbl_name; - public static final int TBL_NAME = 2; - private String index_name; - public static final int INDEX_NAME = 3; + private boolean success; + public static final int SUCCESS = 0; + private MetaException o1; + public static final int O1 = 1; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { - } - - public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ - put(DB_NAME, new FieldMetaData("db_name", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRING))); - put(TBL_NAME, new FieldMetaData("tbl_name", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRING))); - put(INDEX_NAME, new FieldMetaData("index_name", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRING))); + public boolean success = false; + } + + public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ + put(SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.BOOL))); + put(O1, new FieldMetaData("o1", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRUCT))); }}); static { - FieldMetaData.addStructMetaDataMap(get_index_by_name_args.class, metaDataMap); + FieldMetaData.addStructMetaDataMap(grant_privileges_result.class, metaDataMap); } - public get_index_by_name_args() { + public grant_privileges_result() { } - public get_index_by_name_args( - String db_name, - String tbl_name, - String index_name) + public grant_privileges_result( + boolean success, + MetaException o1) { this(); - this.db_name = db_name; - this.tbl_name = tbl_name; - this.index_name = index_name; + this.success = success; + this.__isset.success = true; + this.o1 = o1; } /** * Performs a deep copy on other. */ - public get_index_by_name_args(get_index_by_name_args other) { - if (other.isSetDb_name()) { - this.db_name = other.db_name; - } - if (other.isSetTbl_name()) { - this.tbl_name = other.tbl_name; - } - if (other.isSetIndex_name()) { - this.index_name = other.index_name; + public grant_privileges_result(grant_privileges_result other) { + __isset.success = other.__isset.success; + this.success = other.success; + if (other.isSetO1()) { + this.o1 = new MetaException(other.o1); } } @Override - public get_index_by_name_args clone() { - return new get_index_by_name_args(this); - } - - public String getDb_name() { - return this.db_name; - } - - public void setDb_name(String db_name) { - this.db_name = db_name; - } - - public void unsetDb_name() { - this.db_name = null; - } - - // Returns true if field db_name is set (has been asigned a value) and false otherwise - public boolean isSetDb_name() { - return this.db_name != null; + public grant_privileges_result clone() { + return new grant_privileges_result(this); } - public String getTbl_name() { - return this.tbl_name; + public boolean isSuccess() { + return this.success; } - public void setTbl_name(String tbl_name) { - this.tbl_name = tbl_name; + public void setSuccess(boolean success) { + this.success = success; + this.__isset.success = true; } - public void unsetTbl_name() { - this.tbl_name = null; + public void unsetSuccess() { + this.__isset.success = false; } - // Returns true if field tbl_name is set (has been asigned a value) and false otherwise - public boolean isSetTbl_name() { - return this.tbl_name != null; + // Returns true if field success is set (has been asigned a value) and false otherwise + public boolean isSetSuccess() { + return this.__isset.success; } - public String getIndex_name() { - return this.index_name; + public MetaException getO1() { + return this.o1; } - public void setIndex_name(String index_name) { - this.index_name = index_name; + public void setO1(MetaException o1) { + this.o1 = o1; } - public void unsetIndex_name() { - this.index_name = null; + public void unsetO1() { + this.o1 = null; } - // Returns true if field index_name is set (has been asigned a value) and false otherwise - public boolean isSetIndex_name() { - return this.index_name != null; + // Returns true if field o1 is set (has been asigned a value) and false otherwise + public boolean isSetO1() { + return this.o1 != null; } public void setFieldValue(int fieldID, Object value) { switch (fieldID) { - case DB_NAME: - if (value == null) { - unsetDb_name(); - } else { - setDb_name((String)value); - } - break; - - case TBL_NAME: + case SUCCESS: if (value == null) { - unsetTbl_name(); + unsetSuccess(); } else { - setTbl_name((String)value); + setSuccess((Boolean)value); } break; - case INDEX_NAME: + case O1: if (value == null) { - unsetIndex_name(); + unsetO1(); } else { - setIndex_name((String)value); + setO1((MetaException)value); } break; @@ -24327,14 +37384,11 @@ public Object getFieldValue(int fieldID) { switch (fieldID) { - case DB_NAME: - return getDb_name(); - - case TBL_NAME: - return getTbl_name(); + case SUCCESS: + return new Boolean(isSuccess()); - case INDEX_NAME: - return getIndex_name(); + case O1: + return getO1(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); @@ -24344,12 +37398,10 @@ // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise public boolean isSet(int fieldID) { switch (fieldID) { - case DB_NAME: - return isSetDb_name(); - case TBL_NAME: - return isSetTbl_name(); - case INDEX_NAME: - return isSetIndex_name(); + case SUCCESS: + return isSetSuccess(); + case O1: + return isSetO1(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -24359,39 +37411,30 @@ public boolean equals(Object that) { if (that == null) return false; - if (that instanceof get_index_by_name_args) - return this.equals((get_index_by_name_args)that); + if (that instanceof grant_privileges_result) + return this.equals((grant_privileges_result)that); return false; } - public boolean equals(get_index_by_name_args that) { + public boolean equals(grant_privileges_result that) { if (that == null) 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) { - if (!(this_present_db_name && that_present_db_name)) - return false; - if (!this.db_name.equals(that.db_name)) - return false; - } - - boolean this_present_tbl_name = true && this.isSetTbl_name(); - boolean that_present_tbl_name = true && that.isSetTbl_name(); - if (this_present_tbl_name || that_present_tbl_name) { - if (!(this_present_tbl_name && that_present_tbl_name)) + boolean this_present_success = true; + boolean that_present_success = true; + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) return false; - if (!this.tbl_name.equals(that.tbl_name)) + if (this.success != that.success) return false; } - boolean this_present_index_name = true && this.isSetIndex_name(); - boolean that_present_index_name = true && that.isSetIndex_name(); - if (this_present_index_name || that_present_index_name) { - if (!(this_present_index_name && that_present_index_name)) + boolean this_present_o1 = true && this.isSetO1(); + boolean that_present_o1 = true && that.isSetO1(); + if (this_present_o1 || that_present_o1) { + if (!(this_present_o1 && that_present_o1)) return false; - if (!this.index_name.equals(that.index_name)) + if (!this.o1.equals(that.o1)) return false; } @@ -24414,23 +37457,18 @@ } switch (field.id) { - case DB_NAME: - if (field.type == TType.STRING) { - this.db_name = iprot.readString(); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - case TBL_NAME: - if (field.type == TType.STRING) { - this.tbl_name = iprot.readString(); + case SUCCESS: + if (field.type == TType.BOOL) { + this.success = iprot.readBool(); + this.__isset.success = true; } else { TProtocolUtil.skip(iprot, field.type); } break; - case INDEX_NAME: - if (field.type == TType.STRING) { - this.index_name = iprot.readString(); + case O1: + if (field.type == TType.STRUCT) { + this.o1 = new MetaException(); + this.o1.read(iprot); } else { TProtocolUtil.skip(iprot, field.type); } @@ -24447,22 +37485,15 @@ } public void write(TProtocol oprot) throws TException { - validate(); - oprot.writeStructBegin(STRUCT_DESC); - if (this.db_name != null) { - oprot.writeFieldBegin(DB_NAME_FIELD_DESC); - oprot.writeString(this.db_name); - oprot.writeFieldEnd(); - } - if (this.tbl_name != null) { - oprot.writeFieldBegin(TBL_NAME_FIELD_DESC); - oprot.writeString(this.tbl_name); + + if (this.isSetSuccess()) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + oprot.writeBool(this.success); oprot.writeFieldEnd(); - } - if (this.index_name != null) { - oprot.writeFieldBegin(INDEX_NAME_FIELD_DESC); - oprot.writeString(this.index_name); + } else if (this.isSetO1()) { + oprot.writeFieldBegin(O1_FIELD_DESC); + this.o1.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); @@ -24471,30 +37502,18 @@ @Override public String toString() { - StringBuilder sb = new StringBuilder("get_index_by_name_args("); + StringBuilder sb = new StringBuilder("grant_privileges_result("); boolean first = true; - sb.append("db_name:"); - if (this.db_name == null) { - sb.append("null"); - } else { - sb.append(this.db_name); - } - first = false; - if (!first) sb.append(", "); - sb.append("tbl_name:"); - if (this.tbl_name == null) { - sb.append("null"); - } else { - sb.append(this.tbl_name); - } + sb.append("success:"); + sb.append(this.success); first = false; if (!first) sb.append(", "); - sb.append("index_name:"); - if (this.index_name == null) { + sb.append("o1:"); + if (this.o1 == null) { sb.append("null"); } else { - sb.append(this.index_name); + sb.append(this.o1); } first = false; sb.append(")"); @@ -24508,144 +37527,183 @@ } - public static class get_index_by_name_result implements TBase, java.io.Serializable, Cloneable { - private static final TStruct STRUCT_DESC = new TStruct("get_index_by_name_result"); - private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.STRUCT, (short)0); - private static final TField O1_FIELD_DESC = new TField("o1", TType.STRUCT, (short)1); - private static final TField O2_FIELD_DESC = new TField("o2", TType.STRUCT, (short)2); - - private Index success; - public static final int SUCCESS = 0; - private MetaException o1; - public static final int O1 = 1; - private NoSuchObjectException o2; - public static final int O2 = 2; + public static class revoke_privileges_args implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("revoke_privileges_args"); + private static final TField USER_NAME_FIELD_DESC = new TField("user_name", TType.STRING, (short)1); + private static final TField IS_ROLE_FIELD_DESC = new TField("is_role", TType.BOOL, (short)2); + private static final TField IS_GROUP_FIELD_DESC = new TField("is_group", TType.BOOL, (short)3); + private static final TField PRIVILEGES_FIELD_DESC = new TField("privileges", TType.STRUCT, (short)4); + + private String user_name; + public static final int USER_NAME = 1; + private boolean is_role; + public static final int IS_ROLE = 2; + private boolean is_group; + public static final int IS_GROUP = 3; + private PrivilegeBag privileges; + public static final int PRIVILEGES = 4; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { + public boolean is_role = false; + public boolean is_group = false; } public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ - put(SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, - new StructMetaData(TType.STRUCT, Index.class))); - put(O1, new FieldMetaData("o1", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRUCT))); - put(O2, new FieldMetaData("o2", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRUCT))); + put(USER_NAME, new FieldMetaData("user_name", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + put(IS_ROLE, new FieldMetaData("is_role", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.BOOL))); + put(IS_GROUP, new FieldMetaData("is_group", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.BOOL))); + put(PRIVILEGES, new FieldMetaData("privileges", TFieldRequirementType.DEFAULT, + new StructMetaData(TType.STRUCT, PrivilegeBag.class))); }}); static { - FieldMetaData.addStructMetaDataMap(get_index_by_name_result.class, metaDataMap); + FieldMetaData.addStructMetaDataMap(revoke_privileges_args.class, metaDataMap); } - public get_index_by_name_result() { + public revoke_privileges_args() { } - public get_index_by_name_result( - Index success, - MetaException o1, - NoSuchObjectException o2) + public revoke_privileges_args( + String user_name, + boolean is_role, + boolean is_group, + PrivilegeBag privileges) { this(); - this.success = success; - this.o1 = o1; - this.o2 = o2; + this.user_name = user_name; + this.is_role = is_role; + this.__isset.is_role = true; + this.is_group = is_group; + this.__isset.is_group = true; + this.privileges = privileges; } /** * Performs a deep copy on other. */ - public get_index_by_name_result(get_index_by_name_result other) { - if (other.isSetSuccess()) { - this.success = new Index(other.success); - } - if (other.isSetO1()) { - this.o1 = new MetaException(other.o1); + public revoke_privileges_args(revoke_privileges_args other) { + if (other.isSetUser_name()) { + this.user_name = other.user_name; } - if (other.isSetO2()) { - this.o2 = new NoSuchObjectException(other.o2); + __isset.is_role = other.__isset.is_role; + this.is_role = other.is_role; + __isset.is_group = other.__isset.is_group; + this.is_group = other.is_group; + if (other.isSetPrivileges()) { + this.privileges = new PrivilegeBag(other.privileges); } } @Override - public get_index_by_name_result clone() { - return new get_index_by_name_result(this); + public revoke_privileges_args clone() { + return new revoke_privileges_args(this); } - public Index getSuccess() { - return this.success; + public String getUser_name() { + return this.user_name; } - public void setSuccess(Index success) { - this.success = success; + public void setUser_name(String user_name) { + this.user_name = user_name; } - public void unsetSuccess() { - this.success = null; + public void unsetUser_name() { + this.user_name = null; } - // Returns true if field success is set (has been asigned a value) and false otherwise - public boolean isSetSuccess() { - return this.success != null; + // Returns true if field user_name is set (has been asigned a value) and false otherwise + public boolean isSetUser_name() { + return this.user_name != null; } - public MetaException getO1() { - return this.o1; + public boolean isIs_role() { + return this.is_role; } - public void setO1(MetaException o1) { - this.o1 = o1; + public void setIs_role(boolean is_role) { + this.is_role = is_role; + this.__isset.is_role = true; } - public void unsetO1() { - this.o1 = null; + public void unsetIs_role() { + this.__isset.is_role = false; } - // Returns true if field o1 is set (has been asigned a value) and false otherwise - public boolean isSetO1() { - return this.o1 != null; + // Returns true if field is_role is set (has been asigned a value) and false otherwise + public boolean isSetIs_role() { + return this.__isset.is_role; } - public NoSuchObjectException getO2() { - return this.o2; + public boolean isIs_group() { + return this.is_group; } - public void setO2(NoSuchObjectException o2) { - this.o2 = o2; + public void setIs_group(boolean is_group) { + this.is_group = is_group; + this.__isset.is_group = true; } - public void unsetO2() { - this.o2 = null; + public void unsetIs_group() { + this.__isset.is_group = false; } - // Returns true if field o2 is set (has been asigned a value) and false otherwise - public boolean isSetO2() { - return this.o2 != null; + // Returns true if field is_group is set (has been asigned a value) and false otherwise + public boolean isSetIs_group() { + return this.__isset.is_group; + } + + public PrivilegeBag getPrivileges() { + return this.privileges; + } + + public void setPrivileges(PrivilegeBag privileges) { + this.privileges = privileges; + } + + public void unsetPrivileges() { + this.privileges = null; + } + + // Returns true if field privileges is set (has been asigned a value) and false otherwise + public boolean isSetPrivileges() { + return this.privileges != null; } public void setFieldValue(int fieldID, Object value) { switch (fieldID) { - case SUCCESS: + case USER_NAME: if (value == null) { - unsetSuccess(); + unsetUser_name(); } else { - setSuccess((Index)value); + setUser_name((String)value); } break; - case O1: + case IS_ROLE: if (value == null) { - unsetO1(); + unsetIs_role(); } else { - setO1((MetaException)value); + setIs_role((Boolean)value); } break; - case O2: + case IS_GROUP: if (value == null) { - unsetO2(); + unsetIs_group(); } else { - setO2((NoSuchObjectException)value); + setIs_group((Boolean)value); + } + break; + + case PRIVILEGES: + if (value == null) { + unsetPrivileges(); + } else { + setPrivileges((PrivilegeBag)value); } break; @@ -24656,14 +37714,17 @@ public Object getFieldValue(int fieldID) { switch (fieldID) { - case SUCCESS: - return getSuccess(); + case USER_NAME: + return getUser_name(); - case O1: - return getO1(); + case IS_ROLE: + return new Boolean(isIs_role()); - case O2: - return getO2(); + case IS_GROUP: + return new Boolean(isIs_group()); + + case PRIVILEGES: + return getPrivileges(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); @@ -24673,12 +37734,14 @@ // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise public boolean isSet(int fieldID) { switch (fieldID) { - case SUCCESS: - return isSetSuccess(); - case O1: - return isSetO1(); - case O2: - return isSetO2(); + case USER_NAME: + return isSetUser_name(); + case IS_ROLE: + return isSetIs_role(); + case IS_GROUP: + return isSetIs_group(); + case PRIVILEGES: + return isSetPrivileges(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -24688,39 +37751,48 @@ public boolean equals(Object that) { if (that == null) return false; - if (that instanceof get_index_by_name_result) - return this.equals((get_index_by_name_result)that); + if (that instanceof revoke_privileges_args) + return this.equals((revoke_privileges_args)that); return false; } - public boolean equals(get_index_by_name_result that) { + public boolean equals(revoke_privileges_args that) { if (that == null) return false; - boolean this_present_success = true && this.isSetSuccess(); - boolean that_present_success = true && that.isSetSuccess(); - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) + boolean this_present_user_name = true && this.isSetUser_name(); + boolean that_present_user_name = true && that.isSetUser_name(); + if (this_present_user_name || that_present_user_name) { + if (!(this_present_user_name && that_present_user_name)) return false; - if (!this.success.equals(that.success)) + if (!this.user_name.equals(that.user_name)) return false; } - boolean this_present_o1 = true && this.isSetO1(); - boolean that_present_o1 = true && that.isSetO1(); - if (this_present_o1 || that_present_o1) { - if (!(this_present_o1 && that_present_o1)) + boolean this_present_is_role = true; + boolean that_present_is_role = true; + if (this_present_is_role || that_present_is_role) { + if (!(this_present_is_role && that_present_is_role)) return false; - if (!this.o1.equals(that.o1)) + if (this.is_role != that.is_role) return false; } - boolean this_present_o2 = true && this.isSetO2(); - boolean that_present_o2 = true && that.isSetO2(); - if (this_present_o2 || that_present_o2) { - if (!(this_present_o2 && that_present_o2)) + boolean this_present_is_group = true; + boolean that_present_is_group = true; + if (this_present_is_group || that_present_is_group) { + if (!(this_present_is_group && that_present_is_group)) return false; - if (!this.o2.equals(that.o2)) + if (this.is_group != that.is_group) + return false; + } + + boolean this_present_privileges = true && this.isSetPrivileges(); + boolean that_present_privileges = true && that.isSetPrivileges(); + if (this_present_privileges || that_present_privileges) { + if (!(this_present_privileges && that_present_privileges)) + return false; + if (!this.privileges.equals(that.privileges)) return false; } @@ -24743,26 +37815,33 @@ } switch (field.id) { - case SUCCESS: - if (field.type == TType.STRUCT) { - this.success = new Index(); - this.success.read(iprot); + case USER_NAME: + if (field.type == TType.STRING) { + this.user_name = iprot.readString(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case IS_ROLE: + if (field.type == TType.BOOL) { + this.is_role = iprot.readBool(); + this.__isset.is_role = true; } else { TProtocolUtil.skip(iprot, field.type); } break; - case O1: - if (field.type == TType.STRUCT) { - this.o1 = new MetaException(); - this.o1.read(iprot); + case IS_GROUP: + if (field.type == TType.BOOL) { + this.is_group = iprot.readBool(); + this.__isset.is_group = true; } else { TProtocolUtil.skip(iprot, field.type); } break; - case O2: + case PRIVILEGES: if (field.type == TType.STRUCT) { - this.o2 = new NoSuchObjectException(); - this.o2.read(iprot); + this.privileges = new PrivilegeBag(); + this.privileges.read(iprot); } else { TProtocolUtil.skip(iprot, field.type); } @@ -24779,19 +37858,23 @@ } public void write(TProtocol oprot) throws TException { - oprot.writeStructBegin(STRUCT_DESC); + validate(); - if (this.isSetSuccess()) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - this.success.write(oprot); - oprot.writeFieldEnd(); - } else if (this.isSetO1()) { - oprot.writeFieldBegin(O1_FIELD_DESC); - this.o1.write(oprot); + oprot.writeStructBegin(STRUCT_DESC); + if (this.user_name != null) { + oprot.writeFieldBegin(USER_NAME_FIELD_DESC); + oprot.writeString(this.user_name); oprot.writeFieldEnd(); - } else if (this.isSetO2()) { - oprot.writeFieldBegin(O2_FIELD_DESC); - this.o2.write(oprot); + } + oprot.writeFieldBegin(IS_ROLE_FIELD_DESC); + oprot.writeBool(this.is_role); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(IS_GROUP_FIELD_DESC); + oprot.writeBool(this.is_group); + oprot.writeFieldEnd(); + if (this.privileges != null) { + oprot.writeFieldBegin(PRIVILEGES_FIELD_DESC); + this.privileges.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); @@ -24800,30 +37883,30 @@ @Override public String toString() { - StringBuilder sb = new StringBuilder("get_index_by_name_result("); + StringBuilder sb = new StringBuilder("revoke_privileges_args("); boolean first = true; - sb.append("success:"); - if (this.success == null) { + sb.append("user_name:"); + if (this.user_name == null) { sb.append("null"); } else { - sb.append(this.success); + sb.append(this.user_name); } first = false; if (!first) sb.append(", "); - sb.append("o1:"); - if (this.o1 == null) { - sb.append("null"); - } else { - sb.append(this.o1); - } + sb.append("is_role:"); + sb.append(this.is_role); first = false; if (!first) sb.append(", "); - sb.append("o2:"); - if (this.o2 == null) { + sb.append("is_group:"); + sb.append(this.is_group); + first = false; + if (!first) sb.append(", "); + sb.append("privileges:"); + if (this.privileges == null) { sb.append("null"); } else { - sb.append(this.o2); + sb.append(this.privileges); } first = false; sb.append(")"); @@ -24837,148 +37920,111 @@ } - public static class get_indexes_args implements TBase, java.io.Serializable, Cloneable { - private static final TStruct STRUCT_DESC = new TStruct("get_indexes_args"); - private static final TField DB_NAME_FIELD_DESC = new TField("db_name", TType.STRING, (short)1); - private static final TField TBL_NAME_FIELD_DESC = new TField("tbl_name", TType.STRING, (short)2); - private static final TField MAX_INDEXES_FIELD_DESC = new TField("max_indexes", TType.I16, (short)3); + public static class revoke_privileges_result implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("revoke_privileges_result"); + private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.BOOL, (short)0); + private static final TField O1_FIELD_DESC = new TField("o1", TType.STRUCT, (short)1); - private String db_name; - public static final int DB_NAME = 1; - private String tbl_name; - public static final int TBL_NAME = 2; - private short max_indexes; - public static final int MAX_INDEXES = 3; + private boolean success; + public static final int SUCCESS = 0; + private MetaException o1; + public static final int O1 = 1; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { - public boolean max_indexes = false; + public boolean success = false; } public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ - put(DB_NAME, new FieldMetaData("db_name", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRING))); - put(TBL_NAME, new FieldMetaData("tbl_name", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRING))); - put(MAX_INDEXES, new FieldMetaData("max_indexes", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.I16))); + put(SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.BOOL))); + put(O1, new FieldMetaData("o1", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRUCT))); }}); static { - FieldMetaData.addStructMetaDataMap(get_indexes_args.class, metaDataMap); + FieldMetaData.addStructMetaDataMap(revoke_privileges_result.class, metaDataMap); } - public get_indexes_args() { - this.max_indexes = (short)-1; - + public revoke_privileges_result() { } - public get_indexes_args( - String db_name, - String tbl_name, - short max_indexes) + public revoke_privileges_result( + boolean success, + MetaException o1) { this(); - this.db_name = db_name; - this.tbl_name = tbl_name; - this.max_indexes = max_indexes; - this.__isset.max_indexes = true; + this.success = success; + this.__isset.success = true; + this.o1 = o1; } /** * Performs a deep copy on other. */ - public get_indexes_args(get_indexes_args other) { - if (other.isSetDb_name()) { - this.db_name = other.db_name; - } - if (other.isSetTbl_name()) { - this.tbl_name = other.tbl_name; + public revoke_privileges_result(revoke_privileges_result other) { + __isset.success = other.__isset.success; + this.success = other.success; + if (other.isSetO1()) { + this.o1 = new MetaException(other.o1); } - __isset.max_indexes = other.__isset.max_indexes; - this.max_indexes = other.max_indexes; } @Override - public get_indexes_args clone() { - return new get_indexes_args(this); - } - - public String getDb_name() { - return this.db_name; - } - - public void setDb_name(String db_name) { - this.db_name = db_name; - } - - public void unsetDb_name() { - this.db_name = null; - } - - // Returns true if field db_name is set (has been asigned a value) and false otherwise - public boolean isSetDb_name() { - return this.db_name != null; + public revoke_privileges_result clone() { + return new revoke_privileges_result(this); } - public String getTbl_name() { - return this.tbl_name; + public boolean isSuccess() { + return this.success; } - public void setTbl_name(String tbl_name) { - this.tbl_name = tbl_name; + public void setSuccess(boolean success) { + this.success = success; + this.__isset.success = true; } - public void unsetTbl_name() { - this.tbl_name = null; + public void unsetSuccess() { + this.__isset.success = false; } - // Returns true if field tbl_name is set (has been asigned a value) and false otherwise - public boolean isSetTbl_name() { - return this.tbl_name != null; + // Returns true if field success is set (has been asigned a value) and false otherwise + public boolean isSetSuccess() { + return this.__isset.success; } - public short getMax_indexes() { - return this.max_indexes; + public MetaException getO1() { + return this.o1; } - public void setMax_indexes(short max_indexes) { - this.max_indexes = max_indexes; - this.__isset.max_indexes = true; + public void setO1(MetaException o1) { + this.o1 = o1; } - public void unsetMax_indexes() { - this.__isset.max_indexes = false; + public void unsetO1() { + this.o1 = null; } - // Returns true if field max_indexes is set (has been asigned a value) and false otherwise - public boolean isSetMax_indexes() { - return this.__isset.max_indexes; + // Returns true if field o1 is set (has been asigned a value) and false otherwise + public boolean isSetO1() { + return this.o1 != null; } public void setFieldValue(int fieldID, Object value) { switch (fieldID) { - case DB_NAME: - if (value == null) { - unsetDb_name(); - } else { - setDb_name((String)value); - } - break; - - case TBL_NAME: + case SUCCESS: if (value == null) { - unsetTbl_name(); + unsetSuccess(); } else { - setTbl_name((String)value); + setSuccess((Boolean)value); } break; - case MAX_INDEXES: + case O1: if (value == null) { - unsetMax_indexes(); + unsetO1(); } else { - setMax_indexes((Short)value); + setO1((MetaException)value); } break; @@ -24989,14 +38035,11 @@ public Object getFieldValue(int fieldID) { switch (fieldID) { - case DB_NAME: - return getDb_name(); - - case TBL_NAME: - return getTbl_name(); + case SUCCESS: + return new Boolean(isSuccess()); - case MAX_INDEXES: - return new Short(getMax_indexes()); + case O1: + return getO1(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); @@ -25006,12 +38049,10 @@ // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise public boolean isSet(int fieldID) { switch (fieldID) { - case DB_NAME: - return isSetDb_name(); - case TBL_NAME: - return isSetTbl_name(); - case MAX_INDEXES: - return isSetMax_indexes(); + case SUCCESS: + return isSetSuccess(); + case O1: + return isSetO1(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -25021,39 +38062,30 @@ public boolean equals(Object that) { if (that == null) return false; - if (that instanceof get_indexes_args) - return this.equals((get_indexes_args)that); + if (that instanceof revoke_privileges_result) + return this.equals((revoke_privileges_result)that); return false; } - public boolean equals(get_indexes_args that) { + public boolean equals(revoke_privileges_result that) { if (that == null) 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) { - if (!(this_present_db_name && that_present_db_name)) - return false; - if (!this.db_name.equals(that.db_name)) - return false; - } - - boolean this_present_tbl_name = true && this.isSetTbl_name(); - boolean that_present_tbl_name = true && that.isSetTbl_name(); - if (this_present_tbl_name || that_present_tbl_name) { - if (!(this_present_tbl_name && that_present_tbl_name)) + boolean this_present_success = true; + boolean that_present_success = true; + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) return false; - if (!this.tbl_name.equals(that.tbl_name)) + if (this.success != that.success) return false; } - boolean this_present_max_indexes = true; - boolean that_present_max_indexes = true; - if (this_present_max_indexes || that_present_max_indexes) { - if (!(this_present_max_indexes && that_present_max_indexes)) + boolean this_present_o1 = true && this.isSetO1(); + boolean that_present_o1 = true && that.isSetO1(); + if (this_present_o1 || that_present_o1) { + if (!(this_present_o1 && that_present_o1)) return false; - if (this.max_indexes != that.max_indexes) + if (!this.o1.equals(that.o1)) return false; } @@ -25076,24 +38108,18 @@ } switch (field.id) { - case DB_NAME: - if (field.type == TType.STRING) { - this.db_name = iprot.readString(); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - case TBL_NAME: - if (field.type == TType.STRING) { - this.tbl_name = iprot.readString(); + case SUCCESS: + if (field.type == TType.BOOL) { + this.success = iprot.readBool(); + this.__isset.success = true; } else { TProtocolUtil.skip(iprot, field.type); } break; - case MAX_INDEXES: - if (field.type == TType.I16) { - this.max_indexes = iprot.readI16(); - this.__isset.max_indexes = true; + case O1: + if (field.type == TType.STRUCT) { + this.o1 = new MetaException(); + this.o1.read(iprot); } else { TProtocolUtil.skip(iprot, field.type); } @@ -25110,50 +38136,37 @@ } public void write(TProtocol oprot) throws TException { - validate(); - oprot.writeStructBegin(STRUCT_DESC); - if (this.db_name != null) { - oprot.writeFieldBegin(DB_NAME_FIELD_DESC); - oprot.writeString(this.db_name); + + if (this.isSetSuccess()) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + oprot.writeBool(this.success); oprot.writeFieldEnd(); - } - if (this.tbl_name != null) { - oprot.writeFieldBegin(TBL_NAME_FIELD_DESC); - oprot.writeString(this.tbl_name); + } else if (this.isSetO1()) { + oprot.writeFieldBegin(O1_FIELD_DESC); + this.o1.write(oprot); oprot.writeFieldEnd(); } - oprot.writeFieldBegin(MAX_INDEXES_FIELD_DESC); - oprot.writeI16(this.max_indexes); - oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } @Override public String toString() { - StringBuilder sb = new StringBuilder("get_indexes_args("); + StringBuilder sb = new StringBuilder("revoke_privileges_result("); boolean first = true; - sb.append("db_name:"); - if (this.db_name == null) { - sb.append("null"); - } else { - sb.append(this.db_name); - } + sb.append("success:"); + sb.append(this.success); first = false; if (!first) sb.append(", "); - sb.append("tbl_name:"); - if (this.tbl_name == null) { + sb.append("o1:"); + if (this.o1 == null) { sb.append("null"); } else { - sb.append(this.tbl_name); + sb.append(this.o1); } first = false; - if (!first) sb.append(", "); - sb.append("max_indexes:"); - sb.append(this.max_indexes); - first = false; sb.append(")"); return sb.toString(); } @@ -25165,513 +38178,414 @@ } - public static class get_indexes_result implements TBase, java.io.Serializable, Cloneable { - private static final TStruct STRUCT_DESC = new TStruct("get_indexes_result"); - private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.LIST, (short)0); - private static final TField O1_FIELD_DESC = new TField("o1", TType.STRUCT, (short)1); - private static final TField O2_FIELD_DESC = new TField("o2", TType.STRUCT, (short)2); + public static class revoke_all_privileges_args implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("revoke_all_privileges_args"); + private static final TField USER_NAME_FIELD_DESC = new TField("user_name", TType.STRING, (short)1); + private static final TField IS_ROLE_FIELD_DESC = new TField("is_role", TType.BOOL, (short)2); + private static final TField IS_GROUP_FIELD_DESC = new TField("is_group", TType.BOOL, (short)3); + private static final TField REMOVE_USER_PRIV_FIELD_DESC = new TField("remove_user_priv", TType.BOOL, (short)4); + private static final TField DBS_FIELD_DESC = new TField("dbs", TType.LIST, (short)5); + private static final TField TABLES_FIELD_DESC = new TField("tables", TType.LIST, (short)6); + private static final TField PARTS_FIELD_DESC = new TField("parts", TType.LIST, (short)7); + private static final TField COLUMNS_FIELD_DESC = new TField("columns", TType.MAP, (short)8); - private List success; - public static final int SUCCESS = 0; - private NoSuchObjectException o1; - public static final int O1 = 1; - private MetaException o2; - public static final int O2 = 2; + private String user_name; + public static final int USER_NAME = 1; + private boolean is_role; + public static final int IS_ROLE = 2; + private boolean is_group; + public static final int IS_GROUP = 3; + private boolean remove_user_priv; + public static final int REMOVE_USER_PRIV = 4; + private List dbs; + public static final int DBS = 5; + private List
tables; + public static final int TABLES = 6; + private List parts; + public static final int PARTS = 7; + private Map> columns; + public static final int COLUMNS = 8; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { + public boolean is_role = false; + public boolean is_group = false; + public boolean remove_user_priv = false; } public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ - put(SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, + put(USER_NAME, new FieldMetaData("user_name", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + put(IS_ROLE, new FieldMetaData("is_role", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.BOOL))); + put(IS_GROUP, new FieldMetaData("is_group", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.BOOL))); + put(REMOVE_USER_PRIV, new FieldMetaData("remove_user_priv", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.BOOL))); + put(DBS, new FieldMetaData("dbs", TFieldRequirementType.DEFAULT, new ListMetaData(TType.LIST, - new StructMetaData(TType.STRUCT, Index.class)))); - put(O1, new FieldMetaData("o1", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRUCT))); - put(O2, new FieldMetaData("o2", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRUCT))); + new StructMetaData(TType.STRUCT, Database.class)))); + put(TABLES, new FieldMetaData("tables", TFieldRequirementType.DEFAULT, + new ListMetaData(TType.LIST, + new StructMetaData(TType.STRUCT, Table.class)))); + put(PARTS, new FieldMetaData("parts", TFieldRequirementType.DEFAULT, + new ListMetaData(TType.LIST, + new StructMetaData(TType.STRUCT, Partition.class)))); + put(COLUMNS, new FieldMetaData("columns", TFieldRequirementType.DEFAULT, + new MapMetaData(TType.MAP, + new StructMetaData(TType.STRUCT, Table.class), + new ListMetaData(TType.LIST, + new FieldValueMetaData(TType.STRING))))); }}); static { - FieldMetaData.addStructMetaDataMap(get_indexes_result.class, metaDataMap); + FieldMetaData.addStructMetaDataMap(revoke_all_privileges_args.class, metaDataMap); } - public get_indexes_result() { + public revoke_all_privileges_args() { } - public get_indexes_result( - List success, - NoSuchObjectException o1, - MetaException o2) + public revoke_all_privileges_args( + String user_name, + boolean is_role, + boolean is_group, + boolean remove_user_priv, + List dbs, + List
tables, + List parts, + Map> columns) { this(); - this.success = success; - this.o1 = o1; - this.o2 = o2; + this.user_name = user_name; + this.is_role = is_role; + this.__isset.is_role = true; + this.is_group = is_group; + this.__isset.is_group = true; + this.remove_user_priv = remove_user_priv; + this.__isset.remove_user_priv = true; + this.dbs = dbs; + this.tables = tables; + this.parts = parts; + this.columns = columns; } /** * Performs a deep copy on other. */ - public get_indexes_result(get_indexes_result other) { - if (other.isSetSuccess()) { - List __this__success = new ArrayList(); - for (Index other_element : other.success) { - __this__success.add(new Index(other_element)); + public revoke_all_privileges_args(revoke_all_privileges_args other) { + if (other.isSetUser_name()) { + this.user_name = other.user_name; + } + __isset.is_role = other.__isset.is_role; + this.is_role = other.is_role; + __isset.is_group = other.__isset.is_group; + this.is_group = other.is_group; + __isset.remove_user_priv = other.__isset.remove_user_priv; + this.remove_user_priv = other.remove_user_priv; + if (other.isSetDbs()) { + List __this__dbs = new ArrayList(); + for (Database other_element : other.dbs) { + __this__dbs.add(new Database(other_element)); } - this.success = __this__success; + this.dbs = __this__dbs; } - if (other.isSetO1()) { - this.o1 = new NoSuchObjectException(other.o1); + if (other.isSetTables()) { + List
__this__tables = new ArrayList
(); + for (Table other_element : other.tables) { + __this__tables.add(new Table(other_element)); + } + this.tables = __this__tables; } - if (other.isSetO2()) { - this.o2 = new MetaException(other.o2); + if (other.isSetParts()) { + List __this__parts = new ArrayList(); + for (Partition other_element : other.parts) { + __this__parts.add(new Partition(other_element)); + } + this.parts = __this__parts; } - } + if (other.isSetColumns()) { + Map> __this__columns = new HashMap>(); + for (Map.Entry> other_element : other.columns.entrySet()) { - @Override - public get_indexes_result clone() { - return new get_indexes_result(this); - } + Table other_element_key = other_element.getKey(); + List other_element_value = other_element.getValue(); - public int getSuccessSize() { - return (this.success == null) ? 0 : this.success.size(); - } + Table __this__columns_copy_key = new Table(other_element_key); - public java.util.Iterator getSuccessIterator() { - return (this.success == null) ? null : this.success.iterator(); - } + List __this__columns_copy_value = new ArrayList(); + for (String other_element_value_element : other_element_value) { + __this__columns_copy_value.add(other_element_value_element); + } - public void addToSuccess(Index elem) { - if (this.success == null) { - this.success = new ArrayList(); + __this__columns.put(__this__columns_copy_key, __this__columns_copy_value); + } + this.columns = __this__columns; } - this.success.add(elem); - } - - public List getSuccess() { - return this.success; - } - - public void setSuccess(List success) { - this.success = success; - } - - public void unsetSuccess() { - this.success = null; - } - - // Returns true if field success is set (has been asigned a value) and false otherwise - public boolean isSetSuccess() { - return this.success != null; } - public NoSuchObjectException getO1() { - return this.o1; + @Override + public revoke_all_privileges_args clone() { + return new revoke_all_privileges_args(this); } - public void setO1(NoSuchObjectException o1) { - this.o1 = o1; + public String getUser_name() { + return this.user_name; } - public void unsetO1() { - this.o1 = null; + public void setUser_name(String user_name) { + this.user_name = user_name; } - // Returns true if field o1 is set (has been asigned a value) and false otherwise - public boolean isSetO1() { - return this.o1 != null; + public void unsetUser_name() { + this.user_name = null; } - public MetaException getO2() { - return this.o2; + // Returns true if field user_name is set (has been asigned a value) and false otherwise + public boolean isSetUser_name() { + return this.user_name != null; } - public void setO2(MetaException o2) { - this.o2 = o2; + public boolean isIs_role() { + return this.is_role; } - public void unsetO2() { - this.o2 = null; + public void setIs_role(boolean is_role) { + this.is_role = is_role; + this.__isset.is_role = true; } - // Returns true if field o2 is set (has been asigned a value) and false otherwise - public boolean isSetO2() { - return this.o2 != null; + public void unsetIs_role() { + this.__isset.is_role = false; } - public void setFieldValue(int fieldID, Object value) { - switch (fieldID) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((List)value); - } - break; - - case O1: - if (value == null) { - unsetO1(); - } else { - setO1((NoSuchObjectException)value); - } - break; - - case O2: - if (value == null) { - unsetO2(); - } else { - setO2((MetaException)value); - } - break; - - default: - throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); - } + // Returns true if field is_role is set (has been asigned a value) and false otherwise + public boolean isSetIs_role() { + return this.__isset.is_role; } - public Object getFieldValue(int fieldID) { - switch (fieldID) { - case SUCCESS: - return getSuccess(); - - case O1: - return getO1(); - - case O2: - return getO2(); - - default: - throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); - } + public boolean isIs_group() { + return this.is_group; } - // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise - public boolean isSet(int fieldID) { - switch (fieldID) { - case SUCCESS: - return isSetSuccess(); - case O1: - return isSetO1(); - case O2: - return isSetO2(); - default: - throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); - } + public void setIs_group(boolean is_group) { + this.is_group = is_group; + this.__isset.is_group = true; } - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof get_indexes_result) - return this.equals((get_indexes_result)that); - return false; + public void unsetIs_group() { + this.__isset.is_group = false; } - public boolean equals(get_indexes_result that) { - if (that == null) - return false; - - boolean this_present_success = true && this.isSetSuccess(); - boolean that_present_success = true && that.isSetSuccess(); - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) - return false; - if (!this.success.equals(that.success)) - return false; - } - - boolean this_present_o1 = true && this.isSetO1(); - boolean that_present_o1 = true && that.isSetO1(); - if (this_present_o1 || that_present_o1) { - if (!(this_present_o1 && that_present_o1)) - return false; - if (!this.o1.equals(that.o1)) - return false; - } - - boolean this_present_o2 = true && this.isSetO2(); - boolean that_present_o2 = true && that.isSetO2(); - if (this_present_o2 || that_present_o2) { - if (!(this_present_o2 && that_present_o2)) - return false; - if (!this.o2.equals(that.o2)) - return false; - } - - return true; + // Returns true if field is_group is set (has been asigned a value) and false otherwise + public boolean isSetIs_group() { + return this.__isset.is_group; } - @Override - public int hashCode() { - return 0; + public boolean isRemove_user_priv() { + return this.remove_user_priv; } - public void read(TProtocol iprot) throws TException { - TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == TType.STOP) { - break; - } - switch (field.id) - { - case SUCCESS: - if (field.type == TType.LIST) { - { - TList _list136 = iprot.readListBegin(); - this.success = new ArrayList(_list136.size); - for (int _i137 = 0; _i137 < _list136.size; ++_i137) - { - Index _elem138; - _elem138 = new Index(); - _elem138.read(iprot); - this.success.add(_elem138); - } - iprot.readListEnd(); - } - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - case O1: - if (field.type == TType.STRUCT) { - this.o1 = new NoSuchObjectException(); - this.o1.read(iprot); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - case O2: - if (field.type == TType.STRUCT) { - this.o2 = new MetaException(); - this.o2.read(iprot); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - default: - TProtocolUtil.skip(iprot, field.type); - break; - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - validate(); + public void setRemove_user_priv(boolean remove_user_priv) { + this.remove_user_priv = remove_user_priv; + this.__isset.remove_user_priv = true; } - public void write(TProtocol oprot) throws TException { - oprot.writeStructBegin(STRUCT_DESC); - - if (this.isSetSuccess()) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - { - oprot.writeListBegin(new TList(TType.STRUCT, this.success.size())); - for (Index _iter139 : this.success) { - _iter139.write(oprot); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } else if (this.isSetO1()) { - oprot.writeFieldBegin(O1_FIELD_DESC); - this.o1.write(oprot); - oprot.writeFieldEnd(); - } else if (this.isSetO2()) { - oprot.writeFieldBegin(O2_FIELD_DESC); - this.o2.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); + public void unsetRemove_user_priv() { + this.__isset.remove_user_priv = false; } - @Override - public String toString() { - StringBuilder sb = new StringBuilder("get_indexes_result("); - boolean first = true; + // Returns true if field remove_user_priv is set (has been asigned a value) and false otherwise + public boolean isSetRemove_user_priv() { + return this.__isset.remove_user_priv; + } - sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } - first = false; - if (!first) sb.append(", "); - sb.append("o1:"); - if (this.o1 == null) { - sb.append("null"); - } else { - sb.append(this.o1); - } - first = false; - if (!first) sb.append(", "); - sb.append("o2:"); - if (this.o2 == null) { - sb.append("null"); - } else { - sb.append(this.o2); + public int getDbsSize() { + return (this.dbs == null) ? 0 : this.dbs.size(); + } + + public java.util.Iterator getDbsIterator() { + return (this.dbs == null) ? null : this.dbs.iterator(); + } + + public void addToDbs(Database elem) { + if (this.dbs == null) { + this.dbs = new ArrayList(); } - first = false; - sb.append(")"); - return sb.toString(); + this.dbs.add(elem); } - public void validate() throws TException { - // check for required fields - // check that fields of type enum have valid values + public List getDbs() { + return this.dbs; } - } + public void setDbs(List dbs) { + this.dbs = dbs; + } - public static class get_index_names_args implements TBase, java.io.Serializable, Cloneable { - private static final TStruct STRUCT_DESC = new TStruct("get_index_names_args"); - private static final TField DB_NAME_FIELD_DESC = new TField("db_name", TType.STRING, (short)1); - private static final TField TBL_NAME_FIELD_DESC = new TField("tbl_name", TType.STRING, (short)2); - private static final TField MAX_INDEXES_FIELD_DESC = new TField("max_indexes", TType.I16, (short)3); + public void unsetDbs() { + this.dbs = null; + } - private String db_name; - public static final int DB_NAME = 1; - private String tbl_name; - public static final int TBL_NAME = 2; - private short max_indexes; - public static final int MAX_INDEXES = 3; + // Returns true if field dbs is set (has been asigned a value) and false otherwise + public boolean isSetDbs() { + return this.dbs != null; + } - private final Isset __isset = new Isset(); - private static final class Isset implements java.io.Serializable { - public boolean max_indexes = false; + public int getTablesSize() { + return (this.tables == null) ? 0 : this.tables.size(); } - public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ - put(DB_NAME, new FieldMetaData("db_name", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRING))); - put(TBL_NAME, new FieldMetaData("tbl_name", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRING))); - put(MAX_INDEXES, new FieldMetaData("max_indexes", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.I16))); - }}); + public java.util.Iterator
getTablesIterator() { + return (this.tables == null) ? null : this.tables.iterator(); + } - static { - FieldMetaData.addStructMetaDataMap(get_index_names_args.class, metaDataMap); + public void addToTables(Table elem) { + if (this.tables == null) { + this.tables = new ArrayList
(); + } + this.tables.add(elem); } - public get_index_names_args() { - this.max_indexes = (short)-1; + public List
getTables() { + return this.tables; + } + public void setTables(List
tables) { + this.tables = tables; } - public get_index_names_args( - String db_name, - String tbl_name, - short max_indexes) - { - this(); - this.db_name = db_name; - this.tbl_name = tbl_name; - this.max_indexes = max_indexes; - this.__isset.max_indexes = true; + public void unsetTables() { + this.tables = null; } - /** - * Performs a deep copy on other. - */ - public get_index_names_args(get_index_names_args other) { - if (other.isSetDb_name()) { - this.db_name = other.db_name; - } - if (other.isSetTbl_name()) { - this.tbl_name = other.tbl_name; - } - __isset.max_indexes = other.__isset.max_indexes; - this.max_indexes = other.max_indexes; + // Returns true if field tables is set (has been asigned a value) and false otherwise + public boolean isSetTables() { + return this.tables != null; } - @Override - public get_index_names_args clone() { - return new get_index_names_args(this); + public int getPartsSize() { + return (this.parts == null) ? 0 : this.parts.size(); } - public String getDb_name() { - return this.db_name; + public java.util.Iterator getPartsIterator() { + return (this.parts == null) ? null : this.parts.iterator(); } - public void setDb_name(String db_name) { - this.db_name = db_name; + public void addToParts(Partition elem) { + if (this.parts == null) { + this.parts = new ArrayList(); + } + this.parts.add(elem); } - public void unsetDb_name() { - this.db_name = null; + public List getParts() { + return this.parts; } - // Returns true if field db_name is set (has been asigned a value) and false otherwise - public boolean isSetDb_name() { - return this.db_name != null; + public void setParts(List parts) { + this.parts = parts; } - public String getTbl_name() { - return this.tbl_name; + public void unsetParts() { + this.parts = null; } - public void setTbl_name(String tbl_name) { - this.tbl_name = tbl_name; + // Returns true if field parts is set (has been asigned a value) and false otherwise + public boolean isSetParts() { + return this.parts != null; } - public void unsetTbl_name() { - this.tbl_name = null; + public int getColumnsSize() { + return (this.columns == null) ? 0 : this.columns.size(); } - // Returns true if field tbl_name is set (has been asigned a value) and false otherwise - public boolean isSetTbl_name() { - return this.tbl_name != null; + public void putToColumns(Table key, List val) { + if (this.columns == null) { + this.columns = new HashMap>(); + } + this.columns.put(key, val); } - public short getMax_indexes() { - return this.max_indexes; + public Map> getColumns() { + return this.columns; } - public void setMax_indexes(short max_indexes) { - this.max_indexes = max_indexes; - this.__isset.max_indexes = true; + public void setColumns(Map> columns) { + this.columns = columns; } - public void unsetMax_indexes() { - this.__isset.max_indexes = false; + public void unsetColumns() { + this.columns = null; } - // Returns true if field max_indexes is set (has been asigned a value) and false otherwise - public boolean isSetMax_indexes() { - return this.__isset.max_indexes; + // Returns true if field columns is set (has been asigned a value) and false otherwise + public boolean isSetColumns() { + return this.columns != null; } public void setFieldValue(int fieldID, Object value) { switch (fieldID) { - case DB_NAME: + case USER_NAME: if (value == null) { - unsetDb_name(); + unsetUser_name(); } else { - setDb_name((String)value); + setUser_name((String)value); } break; - case TBL_NAME: + case IS_ROLE: if (value == null) { - unsetTbl_name(); + unsetIs_role(); } else { - setTbl_name((String)value); + setIs_role((Boolean)value); } break; - case MAX_INDEXES: + case IS_GROUP: if (value == null) { - unsetMax_indexes(); + unsetIs_group(); } else { - setMax_indexes((Short)value); + setIs_group((Boolean)value); + } + break; + + case REMOVE_USER_PRIV: + if (value == null) { + unsetRemove_user_priv(); + } else { + setRemove_user_priv((Boolean)value); + } + break; + + case DBS: + if (value == null) { + unsetDbs(); + } else { + setDbs((List)value); + } + break; + + case TABLES: + if (value == null) { + unsetTables(); + } else { + setTables((List
)value); + } + break; + + case PARTS: + if (value == null) { + unsetParts(); + } else { + setParts((List)value); + } + break; + + case COLUMNS: + if (value == null) { + unsetColumns(); + } else { + setColumns((Map>)value); } break; @@ -25682,14 +38596,29 @@ public Object getFieldValue(int fieldID) { switch (fieldID) { - case DB_NAME: - return getDb_name(); + case USER_NAME: + return getUser_name(); - case TBL_NAME: - return getTbl_name(); + case IS_ROLE: + return new Boolean(isIs_role()); - case MAX_INDEXES: - return new Short(getMax_indexes()); + case IS_GROUP: + return new Boolean(isIs_group()); + + case REMOVE_USER_PRIV: + return new Boolean(isRemove_user_priv()); + + case DBS: + return getDbs(); + + case TABLES: + return getTables(); + + case PARTS: + return getParts(); + + case COLUMNS: + return getColumns(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); @@ -25698,13 +38627,23 @@ // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise public boolean isSet(int fieldID) { - switch (fieldID) { - case DB_NAME: - return isSetDb_name(); - case TBL_NAME: - return isSetTbl_name(); - case MAX_INDEXES: - return isSetMax_indexes(); + switch (fieldID) { + case USER_NAME: + return isSetUser_name(); + case IS_ROLE: + return isSetIs_role(); + case IS_GROUP: + return isSetIs_group(); + case REMOVE_USER_PRIV: + return isSetRemove_user_priv(); + case DBS: + return isSetDbs(); + case TABLES: + return isSetTables(); + case PARTS: + return isSetParts(); + case COLUMNS: + return isSetColumns(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -25714,39 +38653,84 @@ public boolean equals(Object that) { if (that == null) return false; - if (that instanceof get_index_names_args) - return this.equals((get_index_names_args)that); + if (that instanceof revoke_all_privileges_args) + return this.equals((revoke_all_privileges_args)that); return false; } - public boolean equals(get_index_names_args that) { + public boolean equals(revoke_all_privileges_args that) { if (that == null) 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) { - if (!(this_present_db_name && that_present_db_name)) + boolean this_present_user_name = true && this.isSetUser_name(); + boolean that_present_user_name = true && that.isSetUser_name(); + if (this_present_user_name || that_present_user_name) { + if (!(this_present_user_name && that_present_user_name)) return false; - if (!this.db_name.equals(that.db_name)) + if (!this.user_name.equals(that.user_name)) return false; } - boolean this_present_tbl_name = true && this.isSetTbl_name(); - boolean that_present_tbl_name = true && that.isSetTbl_name(); - if (this_present_tbl_name || that_present_tbl_name) { - if (!(this_present_tbl_name && that_present_tbl_name)) + boolean this_present_is_role = true; + boolean that_present_is_role = true; + if (this_present_is_role || that_present_is_role) { + if (!(this_present_is_role && that_present_is_role)) return false; - if (!this.tbl_name.equals(that.tbl_name)) + if (this.is_role != that.is_role) return false; } - boolean this_present_max_indexes = true; - boolean that_present_max_indexes = true; - if (this_present_max_indexes || that_present_max_indexes) { - if (!(this_present_max_indexes && that_present_max_indexes)) + boolean this_present_is_group = true; + boolean that_present_is_group = true; + if (this_present_is_group || that_present_is_group) { + if (!(this_present_is_group && that_present_is_group)) return false; - if (this.max_indexes != that.max_indexes) + if (this.is_group != that.is_group) + return false; + } + + boolean this_present_remove_user_priv = true; + boolean that_present_remove_user_priv = true; + if (this_present_remove_user_priv || that_present_remove_user_priv) { + if (!(this_present_remove_user_priv && that_present_remove_user_priv)) + return false; + if (this.remove_user_priv != that.remove_user_priv) + return false; + } + + boolean this_present_dbs = true && this.isSetDbs(); + boolean that_present_dbs = true && that.isSetDbs(); + if (this_present_dbs || that_present_dbs) { + if (!(this_present_dbs && that_present_dbs)) + return false; + if (!this.dbs.equals(that.dbs)) + return false; + } + + boolean this_present_tables = true && this.isSetTables(); + boolean that_present_tables = true && that.isSetTables(); + if (this_present_tables || that_present_tables) { + if (!(this_present_tables && that_present_tables)) + return false; + if (!this.tables.equals(that.tables)) + return false; + } + + boolean this_present_parts = true && this.isSetParts(); + boolean that_present_parts = true && that.isSetParts(); + if (this_present_parts || that_present_parts) { + if (!(this_present_parts && that_present_parts)) + return false; + if (!this.parts.equals(that.parts)) + return false; + } + + boolean this_present_columns = true && this.isSetColumns(); + boolean that_present_columns = true && that.isSetColumns(); + if (this_present_columns || that_present_columns) { + if (!(this_present_columns && that_present_columns)) + return false; + if (!this.columns.equals(that.columns)) return false; } @@ -25769,24 +38753,117 @@ } switch (field.id) { - case DB_NAME: + case USER_NAME: if (field.type == TType.STRING) { - this.db_name = iprot.readString(); + this.user_name = iprot.readString(); } else { TProtocolUtil.skip(iprot, field.type); } break; - case TBL_NAME: - if (field.type == TType.STRING) { - this.tbl_name = iprot.readString(); + case IS_ROLE: + if (field.type == TType.BOOL) { + this.is_role = iprot.readBool(); + this.__isset.is_role = true; } else { TProtocolUtil.skip(iprot, field.type); } break; - case MAX_INDEXES: - if (field.type == TType.I16) { - this.max_indexes = iprot.readI16(); - this.__isset.max_indexes = true; + case IS_GROUP: + if (field.type == TType.BOOL) { + this.is_group = iprot.readBool(); + this.__isset.is_group = true; + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case REMOVE_USER_PRIV: + if (field.type == TType.BOOL) { + this.remove_user_priv = iprot.readBool(); + this.__isset.remove_user_priv = true; + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case DBS: + if (field.type == TType.LIST) { + { + TList _list223 = iprot.readListBegin(); + this.dbs = new ArrayList(_list223.size); + for (int _i224 = 0; _i224 < _list223.size; ++_i224) + { + Database _elem225; + _elem225 = new Database(); + _elem225.read(iprot); + this.dbs.add(_elem225); + } + iprot.readListEnd(); + } + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case TABLES: + if (field.type == TType.LIST) { + { + TList _list226 = iprot.readListBegin(); + this.tables = new ArrayList
(_list226.size); + for (int _i227 = 0; _i227 < _list226.size; ++_i227) + { + Table _elem228; + _elem228 = new Table(); + _elem228.read(iprot); + this.tables.add(_elem228); + } + iprot.readListEnd(); + } + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case PARTS: + if (field.type == TType.LIST) { + { + TList _list229 = iprot.readListBegin(); + this.parts = new ArrayList(_list229.size); + for (int _i230 = 0; _i230 < _list229.size; ++_i230) + { + Partition _elem231; + _elem231 = new Partition(); + _elem231.read(iprot); + this.parts.add(_elem231); + } + iprot.readListEnd(); + } + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case COLUMNS: + if (field.type == TType.MAP) { + { + TMap _map232 = iprot.readMapBegin(); + this.columns = new HashMap>(2*_map232.size); + for (int _i233 = 0; _i233 < _map232.size; ++_i233) + { + Table _key234; + List _val235; + _key234 = new Table(); + _key234.read(iprot); + { + TList _list236 = iprot.readListBegin(); + _val235 = new ArrayList(_list236.size); + for (int _i237 = 0; _i237 < _list236.size; ++_i237) + { + String _elem238; + _elem238 = iprot.readString(); + _val235.add(_elem238); + } + iprot.readListEnd(); + } + this.columns.put(_key234, _val235); + } + iprot.readMapEnd(); + } } else { TProtocolUtil.skip(iprot, field.type); } @@ -25806,46 +38883,130 @@ validate(); oprot.writeStructBegin(STRUCT_DESC); - if (this.db_name != null) { - oprot.writeFieldBegin(DB_NAME_FIELD_DESC); - oprot.writeString(this.db_name); + if (this.user_name != null) { + oprot.writeFieldBegin(USER_NAME_FIELD_DESC); + oprot.writeString(this.user_name); + oprot.writeFieldEnd(); + } + oprot.writeFieldBegin(IS_ROLE_FIELD_DESC); + oprot.writeBool(this.is_role); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(IS_GROUP_FIELD_DESC); + oprot.writeBool(this.is_group); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(REMOVE_USER_PRIV_FIELD_DESC); + oprot.writeBool(this.remove_user_priv); + oprot.writeFieldEnd(); + if (this.dbs != null) { + oprot.writeFieldBegin(DBS_FIELD_DESC); + { + oprot.writeListBegin(new TList(TType.STRUCT, this.dbs.size())); + for (Database _iter239 : this.dbs) { + _iter239.write(oprot); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + if (this.tables != null) { + oprot.writeFieldBegin(TABLES_FIELD_DESC); + { + oprot.writeListBegin(new TList(TType.STRUCT, this.tables.size())); + for (Table _iter240 : this.tables) { + _iter240.write(oprot); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + if (this.parts != null) { + oprot.writeFieldBegin(PARTS_FIELD_DESC); + { + oprot.writeListBegin(new TList(TType.STRUCT, this.parts.size())); + for (Partition _iter241 : this.parts) { + _iter241.write(oprot); + } + oprot.writeListEnd(); + } oprot.writeFieldEnd(); } - if (this.tbl_name != null) { - oprot.writeFieldBegin(TBL_NAME_FIELD_DESC); - oprot.writeString(this.tbl_name); + if (this.columns != null) { + oprot.writeFieldBegin(COLUMNS_FIELD_DESC); + { + oprot.writeMapBegin(new TMap(TType.STRUCT, TType.LIST, this.columns.size())); + for (Map.Entry> _iter242 : this.columns.entrySet()) { + _iter242.getKey().write(oprot); + { + oprot.writeListBegin(new TList(TType.STRING, _iter242.getValue().size())); + for (String _iter243 : _iter242.getValue()) { + oprot.writeString(_iter243); + } + oprot.writeListEnd(); + } + } + oprot.writeMapEnd(); + } oprot.writeFieldEnd(); } - oprot.writeFieldBegin(MAX_INDEXES_FIELD_DESC); - oprot.writeI16(this.max_indexes); - oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } @Override public String toString() { - StringBuilder sb = new StringBuilder("get_index_names_args("); + StringBuilder sb = new StringBuilder("revoke_all_privileges_args("); boolean first = true; - sb.append("db_name:"); - if (this.db_name == null) { + sb.append("user_name:"); + if (this.user_name == null) { sb.append("null"); } else { - sb.append(this.db_name); + sb.append(this.user_name); } first = false; if (!first) sb.append(", "); - sb.append("tbl_name:"); - if (this.tbl_name == null) { + sb.append("is_role:"); + sb.append(this.is_role); + first = false; + if (!first) sb.append(", "); + sb.append("is_group:"); + sb.append(this.is_group); + first = false; + if (!first) sb.append(", "); + sb.append("remove_user_priv:"); + sb.append(this.remove_user_priv); + first = false; + if (!first) sb.append(", "); + sb.append("dbs:"); + if (this.dbs == null) { sb.append("null"); } else { - sb.append(this.tbl_name); + sb.append(this.dbs); } first = false; if (!first) sb.append(", "); - sb.append("max_indexes:"); - sb.append(this.max_indexes); + sb.append("tables:"); + if (this.tables == null) { + sb.append("null"); + } else { + sb.append(this.tables); + } + first = false; + if (!first) sb.append(", "); + sb.append("parts:"); + if (this.parts == null) { + sb.append("null"); + } else { + sb.append(this.parts); + } + first = false; + if (!first) sb.append(", "); + sb.append("columns:"); + if (this.columns == null) { + sb.append("null"); + } else { + sb.append(this.columns); + } first = false; sb.append(")"); return sb.toString(); @@ -25858,112 +39019,94 @@ } - public static class get_index_names_result implements TBase, java.io.Serializable, Cloneable { - private static final TStruct STRUCT_DESC = new TStruct("get_index_names_result"); - private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.LIST, (short)0); - private static final TField O2_FIELD_DESC = new TField("o2", TType.STRUCT, (short)1); + public static class revoke_all_privileges_result implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("revoke_all_privileges_result"); + private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.BOOL, (short)0); + private static final TField O1_FIELD_DESC = new TField("o1", TType.STRUCT, (short)1); - private List success; + private boolean success; public static final int SUCCESS = 0; - private MetaException o2; - public static final int O2 = 1; + private MetaException o1; + public static final int O1 = 1; private final Isset __isset = new Isset(); private static final class Isset implements java.io.Serializable { + public boolean success = false; } public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ put(SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, - new ListMetaData(TType.LIST, - new FieldValueMetaData(TType.STRING)))); - put(O2, new FieldMetaData("o2", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.BOOL))); + put(O1, new FieldMetaData("o1", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRUCT))); }}); static { - FieldMetaData.addStructMetaDataMap(get_index_names_result.class, metaDataMap); + FieldMetaData.addStructMetaDataMap(revoke_all_privileges_result.class, metaDataMap); } - public get_index_names_result() { + public revoke_all_privileges_result() { } - public get_index_names_result( - List success, - MetaException o2) + public revoke_all_privileges_result( + boolean success, + MetaException o1) { this(); this.success = success; - this.o2 = o2; + this.__isset.success = true; + this.o1 = o1; } /** * Performs a deep copy on other. */ - public get_index_names_result(get_index_names_result other) { - if (other.isSetSuccess()) { - List __this__success = new ArrayList(); - for (String other_element : other.success) { - __this__success.add(other_element); - } - this.success = __this__success; - } - if (other.isSetO2()) { - this.o2 = new MetaException(other.o2); + public revoke_all_privileges_result(revoke_all_privileges_result other) { + __isset.success = other.__isset.success; + this.success = other.success; + if (other.isSetO1()) { + this.o1 = new MetaException(other.o1); } } @Override - public get_index_names_result clone() { - return new get_index_names_result(this); - } - - public int getSuccessSize() { - return (this.success == null) ? 0 : this.success.size(); - } - - public java.util.Iterator getSuccessIterator() { - return (this.success == null) ? null : this.success.iterator(); - } - - public void addToSuccess(String elem) { - if (this.success == null) { - this.success = new ArrayList(); - } - this.success.add(elem); + public revoke_all_privileges_result clone() { + return new revoke_all_privileges_result(this); } - public List getSuccess() { + public boolean isSuccess() { return this.success; } - public void setSuccess(List success) { + public void setSuccess(boolean success) { this.success = success; + this.__isset.success = true; } public void unsetSuccess() { - this.success = null; + this.__isset.success = false; } // Returns true if field success is set (has been asigned a value) and false otherwise public boolean isSetSuccess() { - return this.success != null; + return this.__isset.success; } - public MetaException getO2() { - return this.o2; + public MetaException getO1() { + return this.o1; } - public void setO2(MetaException o2) { - this.o2 = o2; + public void setO1(MetaException o1) { + this.o1 = o1; } - public void unsetO2() { - this.o2 = null; + public void unsetO1() { + this.o1 = null; } - // Returns true if field o2 is set (has been asigned a value) and false otherwise - public boolean isSetO2() { - return this.o2 != null; + // Returns true if field o1 is set (has been asigned a value) and false otherwise + public boolean isSetO1() { + return this.o1 != null; } public void setFieldValue(int fieldID, Object value) { @@ -25972,15 +39115,15 @@ if (value == null) { unsetSuccess(); } else { - setSuccess((List)value); + setSuccess((Boolean)value); } break; - case O2: + case O1: if (value == null) { - unsetO2(); + unsetO1(); } else { - setO2((MetaException)value); + setO1((MetaException)value); } break; @@ -25992,10 +39135,10 @@ public Object getFieldValue(int fieldID) { switch (fieldID) { case SUCCESS: - return getSuccess(); + return new Boolean(isSuccess()); - case O2: - return getO2(); + case O1: + return getO1(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); @@ -26007,8 +39150,8 @@ switch (fieldID) { case SUCCESS: return isSetSuccess(); - case O2: - return isSetO2(); + case O1: + return isSetO1(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } @@ -26018,30 +39161,30 @@ public boolean equals(Object that) { if (that == null) return false; - if (that instanceof get_index_names_result) - return this.equals((get_index_names_result)that); + if (that instanceof revoke_all_privileges_result) + return this.equals((revoke_all_privileges_result)that); return false; } - public boolean equals(get_index_names_result that) { + public boolean equals(revoke_all_privileges_result that) { if (that == null) return false; - boolean this_present_success = true && this.isSetSuccess(); - boolean that_present_success = true && that.isSetSuccess(); + boolean this_present_success = true; + boolean that_present_success = true; if (this_present_success || that_present_success) { if (!(this_present_success && that_present_success)) return false; - if (!this.success.equals(that.success)) + if (this.success != that.success) return false; } - boolean this_present_o2 = true && this.isSetO2(); - boolean that_present_o2 = true && that.isSetO2(); - if (this_present_o2 || that_present_o2) { - if (!(this_present_o2 && that_present_o2)) + boolean this_present_o1 = true && this.isSetO1(); + boolean that_present_o1 = true && that.isSetO1(); + if (this_present_o1 || that_present_o1) { + if (!(this_present_o1 && that_present_o1)) return false; - if (!this.o2.equals(that.o2)) + if (!this.o1.equals(that.o1)) return false; } @@ -26065,26 +39208,17 @@ switch (field.id) { case SUCCESS: - if (field.type == TType.LIST) { - { - TList _list140 = iprot.readListBegin(); - this.success = new ArrayList(_list140.size); - for (int _i141 = 0; _i141 < _list140.size; ++_i141) - { - String _elem142; - _elem142 = iprot.readString(); - this.success.add(_elem142); - } - iprot.readListEnd(); - } + if (field.type == TType.BOOL) { + this.success = iprot.readBool(); + this.__isset.success = true; } else { TProtocolUtil.skip(iprot, field.type); } break; - case O2: + case O1: if (field.type == TType.STRUCT) { - this.o2 = new MetaException(); - this.o2.read(iprot); + this.o1 = new MetaException(); + this.o1.read(iprot); } else { TProtocolUtil.skip(iprot, field.type); } @@ -26105,17 +39239,11 @@ if (this.isSetSuccess()) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - { - oprot.writeListBegin(new TList(TType.STRING, this.success.size())); - for (String _iter143 : this.success) { - oprot.writeString(_iter143); - } - oprot.writeListEnd(); - } + oprot.writeBool(this.success); oprot.writeFieldEnd(); - } else if (this.isSetO2()) { - oprot.writeFieldBegin(O2_FIELD_DESC); - this.o2.write(oprot); + } else if (this.isSetO1()) { + oprot.writeFieldBegin(O1_FIELD_DESC); + this.o1.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); @@ -26124,22 +39252,18 @@ @Override public String toString() { - StringBuilder sb = new StringBuilder("get_index_names_result("); + StringBuilder sb = new StringBuilder("revoke_all_privileges_result("); boolean first = true; sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } + sb.append(this.success); first = false; if (!first) sb.append(", "); - sb.append("o2:"); - if (this.o2 == null) { + sb.append("o1:"); + if (this.o1 == null) { sb.append("null"); } else { - sb.append(this.o2); + sb.append(this.o1); } first = false; sb.append(")"); Index: metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java =================================================================== --- metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java (revision 1030336) +++ metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java (working copy) @@ -48,12 +48,24 @@ import org.apache.hadoop.hive.metastore.api.MetaException; import org.apache.hadoop.hive.metastore.api.NoSuchObjectException; import org.apache.hadoop.hive.metastore.api.Partition; +import org.apache.hadoop.hive.metastore.api.PrincipalPrivilegeSet; +import org.apache.hadoop.hive.metastore.api.PrivilegeBag; +import org.apache.hadoop.hive.metastore.api.PrivilegeSet; +import org.apache.hadoop.hive.metastore.api.Role; +import org.apache.hadoop.hive.metastore.api.SecurityColumn; +import org.apache.hadoop.hive.metastore.api.SecurityDB; +import org.apache.hadoop.hive.metastore.api.SecurityTablePartition; +import org.apache.hadoop.hive.metastore.api.SecurityUser; import org.apache.hadoop.hive.metastore.api.Table; import org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore; import org.apache.hadoop.hive.metastore.api.Type; import org.apache.hadoop.hive.metastore.api.UnknownDBException; import org.apache.hadoop.hive.metastore.api.UnknownTableException; import org.apache.hadoop.hive.metastore.hooks.JDOConnectionURLHook; +import org.apache.hadoop.hive.metastore.model.MSecurityColumn; +import org.apache.hadoop.hive.metastore.model.MSecurityDB; +import org.apache.hadoop.hive.metastore.model.MSecurityTablePartition; +import org.apache.hadoop.hive.metastore.model.MSecurityUser; import org.apache.hadoop.hive.serde2.Deserializer; import org.apache.hadoop.hive.serde2.SerDeException; import org.apache.hadoop.hive.serde2.SerDeUtils; @@ -360,7 +372,7 @@ } catch (NoSuchObjectException e) { ms.createDatabase( new Database(DEFAULT_DATABASE_NAME, DEFAULT_DATABASE_COMMENT, - wh.getDefaultDatabasePath(DEFAULT_DATABASE_NAME).toString())); + wh.getDefaultDatabasePath(DEFAULT_DATABASE_NAME).toString(), null)); } HMSHandler.createDefaultDB = true; } @@ -2122,6 +2134,466 @@ return ret; } + @Override + public PrincipalPrivilegeSet get_column_privilege_set(final String dbName, + final String tableName, final String partName, final String columnName, + final String userName, final List groupNames) throws MetaException, + TException { + incrementCounter("get_column_privilege_set"); + + PrincipalPrivilegeSet ret = null; + try { + ret = executeWithRetry(new Command() { + @Override + PrincipalPrivilegeSet run(RawStore ms) throws Exception { + return ms.getColumnPrivilegeSet(dbName, tableName, partName, columnName, userName, groupNames); + } + }); + } catch (MetaException e) { + throw e; + } catch (Exception e) { + throw new RuntimeException(e); + } + return ret; + } + + @Override + public PrincipalPrivilegeSet get_db_privilege_set(final String dbName, + final String userName, final List groupNames) throws MetaException, + TException { + incrementCounter("get_db_privilege_set"); + + PrincipalPrivilegeSet ret = null; + try { + ret = executeWithRetry(new Command() { + @Override + PrincipalPrivilegeSet run(RawStore ms) throws Exception { + return ms.getDBPrivilegeSet(dbName, userName, groupNames); + } + }); + } catch (MetaException e) { + throw e; + } catch (Exception e) { + throw new RuntimeException(e); + } + return ret; + } + + @Override + public PrincipalPrivilegeSet get_partition_privilege_set( + final String dbName, final String tableName, final String partName, + final String userName, final List groupNames) + throws MetaException, TException { + incrementCounter("get_partition_privilege_set"); + + PrincipalPrivilegeSet ret = null; + try { + ret = executeWithRetry(new Command() { + @Override + PrincipalPrivilegeSet run(RawStore ms) throws Exception { + return ms.getPartitionPrivilegeSet(dbName, tableName, partName, + userName, groupNames); + } + }); + } catch (MetaException e) { + throw e; + } catch (Exception e) { + throw new RuntimeException(e); + } + return ret; + } + + @Override + public PrincipalPrivilegeSet get_table_privilege_set(final String dbName, + final String tableName, final String userName, + final List groupNames) throws MetaException, TException { + incrementCounter("get_table_privilege_set"); + + PrincipalPrivilegeSet ret = null; + try { + ret = executeWithRetry(new Command() { + @Override + PrincipalPrivilegeSet run(RawStore ms) throws Exception { + return ms.getTablePrivilegeSet(dbName, tableName, userName, + groupNames); + } + }); + } catch (MetaException e) { + throw e; + } catch (Exception e) { + throw new RuntimeException(e); + } + return ret; + } + + @Override + public boolean add_role_member(final String roleName, final String userName, + final boolean isRole, final boolean isGroup) throws MetaException, TException { + incrementCounter("add_role_member"); + + Boolean ret = null; + try { + ret = executeWithRetry(new Command() { + @Override + Boolean run(RawStore ms) throws Exception { + Role role = ms.getRole(roleName); + return ms.addRoleMember(role, userName, isRole, isGroup); + } + }); + } catch (MetaException e) { + throw e; + } catch (Exception e) { + throw new RuntimeException(e); + } + return ret; + } + + @Override + public boolean create_role(final String roleName, final String ownerName) + throws MetaException, TException { + incrementCounter("create_role"); + + Boolean ret = null; + try { + + ret = executeWithRetry(new Command() { + @Override + Boolean run(RawStore ms) throws Exception { + return ms.addRole(roleName, ownerName); + } + }); + } catch (MetaException e) { + throw e; + } catch (Exception e) { + throw new RuntimeException(e); + } + return ret; + } + + @Override + public boolean drop_role(final String roleName) + throws MetaException, TException { + incrementCounter("drop_role"); + + Boolean ret = null; + try { + ret = executeWithRetry(new Command() { + @Override + Boolean run(RawStore ms) throws Exception { + return ms.removeRole(roleName); + } + }); + } catch (MetaException e) { + throw e; + } catch (Exception e) { + throw new RuntimeException(e); + } + return ret; + } + + @Override + public boolean grant_privileges(final String userName, final boolean isRole, + final boolean isGroup, final PrivilegeBag privileges, final String grantor) throws MetaException, + TException { + incrementCounter("grant_privileges"); + + Boolean ret = null; + try { + ret = executeWithRetry(new Command() { + @Override + Boolean run(RawStore ms) throws Exception { + return ms.grantPrivileges(userName, isRole, isGroup, privileges, grantor); + } + }); + } catch (MetaException e) { + throw e; + } catch (Exception e) { + throw new RuntimeException(e); + } + return ret; + } + + @Override + public boolean remove_role_member(final String roleName, final String userName, + final boolean isRole, final boolean isGroup) throws MetaException, TException { + incrementCounter("remove_role_member"); + + Boolean ret = null; + try { + ret = executeWithRetry(new Command() { + @Override + Boolean run(RawStore ms) throws Exception { + Role mRole = ms.getRole(roleName); + return ms.removeRoleMember(mRole, userName, isRole, isGroup); + } + }); + } catch (MetaException e) { + throw e; + } catch (Exception e) { + throw new RuntimeException(e); + } + return ret; + } + + @Override + public boolean revoke_privileges(final String userName, final boolean isRole, + final boolean isGroup, final PrivilegeBag privileges) throws MetaException, + TException { + incrementCounter("revoke_privileges"); + + Boolean ret = null; + try { + ret = executeWithRetry(new Command() { + @Override + Boolean run(RawStore ms) throws Exception { + return ms.revokePrivileges(userName, isRole, isGroup, privileges); + } + }); + } catch (MetaException e) { + throw e; + } catch (Exception e) { + throw new RuntimeException(e); + } + return ret; + } + + @Override + public PrincipalPrivilegeSet get_user_privilege_set(final String userName, + final List groupNames) throws MetaException, TException { + incrementCounter("get_user_privilege_set"); + + PrincipalPrivilegeSet ret = null; + try { + ret = executeWithRetry(new Command() { + @Override + PrincipalPrivilegeSet run(RawStore ms) throws Exception { + return ms.getUserPrivilegeSet(userName, groupNames); + } + }); + } catch (MetaException e) { + throw e; + } catch (Exception e) { + throw new RuntimeException(e); + } + return ret; + } + + @Override + public boolean revoke_all_privileges(final String userName, + final boolean isRole, final boolean isGroup, + final boolean removeUserPriv, final List dbs, + final List
tables, final List parts, + final Map> columns) throws MetaException, + TException { + incrementCounter("revoke_all_privileges"); + + Boolean ret = null; + try { + ret = executeWithRetry(new Command() { + @Override + Boolean run(RawStore ms) throws Exception { + return ms.revokeAllPrivileges(userName, isRole, isGroup, + removeUserPriv, dbs, tables, parts, columns); + } + }); + } catch (MetaException e) { + throw e; + } catch (Exception e) { + throw new RuntimeException(e); + } + return ret; + } + + @Override + public List list_security_column_grant( + final String principalName, final boolean isGroup, + final boolean isRole, final String dbName, final String tableName, + final String columnName) throws MetaException, TException { + incrementCounter("list_security_column_grant"); + + List ret = null; + try { + ret = executeWithRetry(new Command>() { + @Override + List run(RawStore ms) throws Exception { + List mCols = ms.listMSecurityPrincipalColumnGrant( + principalName, isGroup, isRole, dbName, tableName, columnName); + Table tbl = ms.getTable(dbName, tableName); + if (mCols.size() > 0) { + List result = new ArrayList(); + for (int i = 0; i < mCols.size(); i++) { + MSecurityColumn sCol = mCols.get(i); + SecurityColumn col = new SecurityColumn( + sCol.getPrincipalName(), sCol.getIsRole(), sCol + .getIsGroup(), sCol.getPrivileges(), sCol + .getCreateTime(), sCol.getGrantor(), tbl, sCol + .getColumnName()); + result.add(col); + } + return result; + } + return null; + } + }); + } catch (MetaException e) { + throw e; + } catch (Exception e) { + throw new RuntimeException(e); + } + return ret; + } + + @Override + public List list_security_db_grant(final String principalName, + final boolean isGroup, final boolean isRole, final String dbName) + throws MetaException, TException { + incrementCounter("list_security_db_grant"); + + List ret = null; + try { + ret = executeWithRetry(new Command>() { + @Override + List run(RawStore ms) throws Exception { + List mDbs = ms.listMSecurityPrincipalDBGrant( + principalName, isGroup, isRole, dbName); + Database db = ms.getDatabase(dbName); + if (mDbs.size() > 0) { + List result = new ArrayList(); + for (int i = 0; i < mDbs.size(); i++) { + MSecurityDB sDB = mDbs.get(i); + SecurityDB secdb = new SecurityDB(sDB.getPrincipalName(), sDB + .getIsRole(), sDB.getIsGroup(), sDB.getPrivileges(), sDB + .getCreateTime(), sDB.getGrantor(), db); + result.add(secdb); + } + return result; + } + return null; + } + }); + } catch (MetaException e) { + throw e; + } catch (Exception e) { + throw new RuntimeException(e); + } + return ret; + } + + @Override + public List list_security_partition_grant( + final String principalName, final boolean isGroup, + final boolean isRole, final String dbName, final String tableName, + final String partName) throws MetaException, TException { + incrementCounter("list_security_partition_grant"); + + List ret = null; + try { + ret = executeWithRetry(new Command>() { + @Override + List run(RawStore ms) throws Exception { + List mParts = ms + .listMSecurityPrincipalPartitionGrant(principalName, isGroup, + isRole, dbName, tableName, partName); + Partition partObj = get_partition_by_name(dbName, tableName, + partName); + if (mParts.size() > 0) { + List result = new ArrayList(); + for (int i = 0; i < mParts.size(); i++) { + MSecurityTablePartition sPart = mParts.get(i); + SecurityTablePartition secPart = new SecurityTablePartition( + sPart.getPrincipalName(), sPart.getIsRole(), sPart + .getIsGroup(), sPart.getPrivileges(), sPart + .getCreateTime(), sPart.getGrantor(), null, partObj); + result.add(secPart); + } + return result; + } + return null; + } + }); + } catch (MetaException e) { + throw e; + } catch (Exception e) { + throw new RuntimeException(e); + } + return ret; + } + + @Override + public List list_security_table_grant( + final String principalName, final boolean isGroup, + final boolean isRole, final String dbName, final String tableName) + throws MetaException, TException { + incrementCounter("list_security_table_grant"); + + List ret = null; + try { + ret = executeWithRetry(new Command>() { + @Override + List run(RawStore ms) throws Exception { + List mTbls = ms + .listMSecurityPrincipalTableGrant(principalName, isGroup, + isRole, dbName, tableName); + Table tblObj = ms.getTable(dbName, tableName); + if (mTbls.size() > 0) { + List result = new ArrayList(); + for (int i = 0; i < mTbls.size(); i++) { + MSecurityTablePartition sTbl = mTbls.get(i); + SecurityTablePartition secPart = new SecurityTablePartition( + sTbl.getPrincipalName(), sTbl.getIsRole(), sTbl + .getIsGroup(), sTbl.getPrivileges(), sTbl + .getCreateTime(), sTbl.getGrantor(), tblObj, null); + result.add(secPart); + } + return result; + } + return null; + } + }); + } catch (MetaException e) { + throw e; + } catch (Exception e) { + throw new RuntimeException(e); + } + return ret; + } + + @Override + public List list_security_user_grant( + final String principlaName, final boolean isRole, final boolean isGroup) + throws MetaException, TException { + incrementCounter("list_security_user_grant"); + + List ret = null; + try { + ret = executeWithRetry(new Command>() { + @Override + List run(RawStore ms) throws Exception { + List mUsers = ms.listMSecurityPrincipalUserGrant( + principlaName, isRole, isGroup); + if (mUsers.size() > 0) { + List result = new ArrayList(); + for (int i = 0; i < mUsers.size(); i++) { + MSecurityUser sUsr = mUsers.get(i); + SecurityUser secUser = new SecurityUser( + sUsr.getPrincipalName(), sUsr.getIsRole(), sUsr + .getIsGroup(), sUsr.getPrivileges(), sUsr + .getCreateTime(), sUsr.getGrantor()); + result.add(secUser); + } + return result; + } + return null; + } + }); + } catch (MetaException e) { + throw e; + } catch (Exception e) { + throw new RuntimeException(e); + } + return ret; + } + } /** Index: metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java =================================================================== --- metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java (revision 1030336) +++ metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java (working copy) @@ -40,6 +40,12 @@ import org.apache.hadoop.hive.metastore.api.MetaException; import org.apache.hadoop.hive.metastore.api.NoSuchObjectException; import org.apache.hadoop.hive.metastore.api.Partition; +import org.apache.hadoop.hive.metastore.api.PrincipalPrivilegeSet; +import org.apache.hadoop.hive.metastore.api.PrivilegeBag; +import org.apache.hadoop.hive.metastore.api.SecurityColumn; +import org.apache.hadoop.hive.metastore.api.SecurityDB; +import org.apache.hadoop.hive.metastore.api.SecurityTablePartition; +import org.apache.hadoop.hive.metastore.api.SecurityUser; import org.apache.hadoop.hive.metastore.api.Table; import org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore; import org.apache.hadoop.hive.metastore.api.Type; @@ -867,4 +873,126 @@ return client.drop_index_by_name(dbName, tblName, name, deleteData); } + @Override + public boolean add_role_member(String roleName, String userName, + boolean isRole, boolean isGroup) throws MetaException, TException { + return client.add_role_member(roleName, userName, isRole, isGroup); + } + + @Override + public boolean create_role(String roleName, String ownerName) + throws MetaException, TException { + return client.create_role(roleName, ownerName); + } + + @Override + public boolean drop_role(String roleName) throws MetaException, TException { + return client.drop_role(roleName); + } + + @Override + public PrincipalPrivilegeSet get_column_privilege_set(String dbName, + String tableName, String partName, String columnName, String userName, + List groupNames) throws MetaException, TException { + return client.get_column_privilege_set(dbName, dbName, partName, + columnName, userName, groupNames); + } + + @Override + public PrincipalPrivilegeSet get_db_privilege_set(String dbName, + String userName, List groupNames) throws MetaException, + TException { + return client.get_db_privilege_set(dbName, userName, groupNames); + } + + @Override + public PrincipalPrivilegeSet get_partition_privilege_set(String dbName, + String tableName, String partName, String userName, + List groupNames) throws MetaException, TException { + return client.get_partition_privilege_set(dbName, tableName, partName, + userName, groupNames); + } + + @Override + public PrincipalPrivilegeSet get_table_privilege_set(String dbName, + String tableName, String userName, List groupNames) + throws MetaException, TException { + return client.get_table_privilege_set(dbName, tableName, userName, + groupNames); + } + + @Override + public PrincipalPrivilegeSet get_user_privilege_set(String userName, + List groupNames) throws MetaException, TException { + return client.get_user_privilege_set(userName, groupNames); + } + + @Override + public boolean grant_privileges(String userName, boolean isRole, + boolean isGroup, PrivilegeBag privileges, String grantor) + throws MetaException, TException { + return client.grant_privileges(userName, isRole, isGroup, privileges, + grantor); + } + + @Override + public boolean remove_role_member(String roleName, String userName, + boolean isRole, boolean isGroup) throws MetaException, TException { + return client.remove_role_member(roleName, userName, isRole, isGroup); + } + + @Override + public boolean revoke_all_privileges(String userName, boolean isRole, + boolean isGroup, boolean removeUserPriv, List dbs, + List
tables, List parts, + Map> columns) throws MetaException, TException { + return client.revoke_all_privileges(userName, isRole, isGroup, + removeUserPriv, dbs, tables, parts, columns); + } + + @Override + public boolean revoke_privileges(String userName, boolean isRole, + boolean isGroup, PrivilegeBag privileges) throws MetaException, + TException { + return client.revoke_privileges(userName, isRole, isGroup, privileges); + } + + @Override + public List list_security_column_grant(String principalName, + boolean isGroup, boolean isRole, String dbName, String tableName, + String columnName) throws MetaException, TException { + return client.list_security_column_grant(principalName, isGroup, isRole, + dbName, tableName, columnName); + } + + @Override + public List list_security_db_grant(String principalName, + boolean isGroup, boolean isRole, String dbName) throws MetaException, + TException { + return client + .list_security_db_grant(principalName, isGroup, isRole, dbName); + } + + @Override + public List list_security_partition_grant( + String principalName, boolean isGroup, boolean isRole, String dbName, + String tableName, String partName) throws MetaException, TException { + return client.list_security_partition_grant(principalName, isGroup, isRole, + dbName, tableName, partName); + } + + @Override + public List list_security_table_grant( + String principalName, boolean isGroup, boolean isRole, String dbName, + String tableName) throws MetaException, TException { + return client.list_security_table_grant(principalName, isGroup, isRole, + dbName, tableName); + } + + @Override + public List list_security_user_grant(String principlaName, + boolean isRole, boolean isGroup) throws MetaException, TException { + return client.list_security_user_grant(principlaName, isRole, isGroup); + } + } Index: metastore/src/java/org/apache/hadoop/hive/metastore/IMetaStoreClient.java =================================================================== --- metastore/src/java/org/apache/hadoop/hive/metastore/IMetaStoreClient.java (revision 1030336) +++ metastore/src/java/org/apache/hadoop/hive/metastore/IMetaStoreClient.java (working copy) @@ -31,6 +31,12 @@ import org.apache.hadoop.hive.metastore.api.MetaException; import org.apache.hadoop.hive.metastore.api.NoSuchObjectException; import org.apache.hadoop.hive.metastore.api.Partition; +import org.apache.hadoop.hive.metastore.api.PrincipalPrivilegeSet; +import org.apache.hadoop.hive.metastore.api.PrivilegeBag; +import org.apache.hadoop.hive.metastore.api.SecurityColumn; +import org.apache.hadoop.hive.metastore.api.SecurityDB; +import org.apache.hadoop.hive.metastore.api.SecurityTablePartition; +import org.apache.hadoop.hive.metastore.api.SecurityUser; import org.apache.hadoop.hive.metastore.api.Table; import org.apache.hadoop.hive.metastore.api.UnknownDBException; import org.apache.hadoop.hive.metastore.api.UnknownTableException; @@ -475,4 +481,279 @@ public boolean dropIndex(String db_name, String tbl_name, String name, boolean deleteData) throws NoSuchObjectException, MetaException, TException; + + /** + * @param user_name + * user name + * @param group_names + * group names + * @return + * @throws MetaException + * @throws TException + */ + public PrincipalPrivilegeSet get_user_privilege_set(String user_name, + List group_names) throws MetaException, TException; + + /** + * @param db_name + * database name + * @param user_name + * user name + * @param group_names + * group names + * @return + * @throws MetaException + * @throws TException + */ + public PrincipalPrivilegeSet get_db_privilege_set(String db_name, + String user_name, List group_names) throws MetaException, + TException; + + /** + * @param db_name + * db name + * @param table_name + * table name + * @param user_name + * user name + * @param group_names + * group names + * @return + * @throws MetaException + * @throws TException + */ + public PrincipalPrivilegeSet get_table_privilege_set(String db_name, + String table_name, String user_name, List group_names) + throws MetaException, TException; + + /** + * @param db_name + * db name + * @param table_name + * table name + * @param part_name + * partition name + * @param user_name + * user name + * @param group_names + * group names + * @return + * @throws MetaException + * @throws TException + */ + public PrincipalPrivilegeSet get_partition_privilege_set(String db_name, + String table_name, String part_name, String user_name, + List group_names) throws MetaException, TException; + + /** + * @param db_name + * database name + * @param table_name + * table name + * @param part_name + * partition name + * @param column_name + * column name + * @param user_name + * user name + * @param group_names + * group names + * @return + * @throws MetaException + * @throws TException + */ + public PrincipalPrivilegeSet get_column_privilege_set(String db_name, + String table_name, String part_name, String column_name, + String user_name, List group_names) throws MetaException, + TException; + + /** + * @param role_name + * role name + * @param owner_name + * owner name + * @return + * @throws MetaException + * @throws TException + */ + public boolean create_role(String role_name, String owner_name) + throws MetaException, TException; + + /** + * @param role_name + * role name + * @return + * @throws MetaException + * @throws TException + */ + public boolean drop_role(String role_name) throws MetaException, TException; + + /** + * @param role_name + * role name + * @param user_name + * user name + * @param is_role + * is the given user name a role name + * @param is_group + * is the given user name a group name + * @return + * @throws MetaException + * @throws TException + */ + public boolean add_role_member(String role_name, String user_name, + boolean is_role, boolean is_group) throws MetaException, TException; + + /** + * @param role_name + * role name + * @param user_name + * user name + * @param is_role + * is the given user name a role + * @param is_group + * is the given group name a group + * @return + * @throws MetaException + * @throws TException + */ + public boolean remove_role_member(String role_name, String user_name, + boolean is_role, boolean is_group) throws MetaException, TException; + + /** + * @param user_name + * user name + * @param is_role + * is the given user name a role + * @param is_group + * is the given user name a group + * @param privileges + * a bag of privilege - including user level, db level, table level, + * and column level + * @param grantor + * the name of the grantor + * @return + * @throws MetaException + * @throws TException + */ + public boolean grant_privileges(String user_name, boolean is_role, + boolean is_group, PrivilegeBag privileges, String grantor) + throws MetaException, TException; + + /** + * @param user_name + * user name + * @param is_role + * is the given user name a role + * @param is_group + * is the given user name a group + * @param privileges + * a bag of privileges + * @return + * @throws MetaException + * @throws TException + */ + public boolean revoke_privileges(String user_name, boolean is_role, + boolean is_group, PrivilegeBag privileges) throws MetaException, + TException; + + /** + * @param user_name + * user name + * @param is_role + * is the given user name a role + * @param is_group + * is the given user name a group + * @param remove_user_priv + * true if need to remove all user level privileges that were + * assigned the the given principal + * @param dbs + * a list of database on which all db level privileges for the given + * principal are going to be remove. + * @param tables + * a list of tables on which all table level privileges for the given + * principal are going to be removed. + * @param parts + * a list of partitions on on which all partition level privileges + * for the given principal are going to be removed. + * @param columns + * a list of columns on on which all column level privileges for the + * given principal are going to be removed. + * @return + * @throws MetaException + * @throws TException + */ + public boolean revoke_all_privileges(String user_name, boolean is_role, + boolean is_group, boolean remove_user_priv, List dbs, + List
tables, List parts, + Map> columns) throws MetaException, TException; + + /** + * @param principla_name + * @param is_role + * @param is_group + * @return + * @throws MetaException + * @throws TException + */ + public List list_security_user_grant(String principla_name, + boolean is_role, boolean is_group) throws MetaException, TException; + + /** + * @param principal_name + * @param is_group + * @param is_role + * @param db_name + * @return + * @throws MetaException + * @throws TException + */ + public List list_security_db_grant(String principal_name, + boolean is_group, boolean is_role, String db_name) throws MetaException, + TException; + + /** + * @param principal_name + * @param is_group + * @param is_role + * @param db_name + * @param table_name + * @return + * @throws MetaException + * @throws TException + */ + public List list_security_table_grant( + String principal_name, boolean is_group, boolean is_role, String db_name, + String table_name) throws MetaException, TException; + + /** + * @param principal_name + * @param is_group + * @param is_role + * @param db_name + * @param table_name + * @param part_name + * @return + * @throws MetaException + * @throws TException + */ + public List list_security_partition_grant( + String principal_name, boolean is_group, boolean is_role, String db_name, + String table_name, String part_name) throws MetaException, TException; + + /** + * @param principal_name + * @param is_group + * @param is_role + * @param db_name + * @param table_name + * @param column_name + * @return + * @throws MetaException + * @throws TException + */ + public List list_security_column_grant(String principal_name, + boolean is_group, boolean is_role, String db_name, String table_name, + String column_name) throws MetaException, TException; + } Index: metastore/src/java/org/apache/hadoop/hive/metastore/ObjectStore.java =================================================================== --- metastore/src/java/org/apache/hadoop/hive/metastore/ObjectStore.java (revision 1030336) +++ metastore/src/java/org/apache/hadoop/hive/metastore/ObjectStore.java (working copy) @@ -45,6 +45,7 @@ import org.apache.hadoop.conf.Configurable; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hive.conf.HiveConf; +import org.apache.hadoop.hive.metastore.api.ColumnPrivilegeBag; import org.apache.hadoop.hive.metastore.api.Database; import org.apache.hadoop.hive.metastore.api.FieldSchema; import org.apache.hadoop.hive.metastore.api.Index; @@ -53,6 +54,9 @@ import org.apache.hadoop.hive.metastore.api.NoSuchObjectException; import org.apache.hadoop.hive.metastore.api.Order; import org.apache.hadoop.hive.metastore.api.Partition; +import org.apache.hadoop.hive.metastore.api.PrincipalPrivilegeSet; +import org.apache.hadoop.hive.metastore.api.PrivilegeBag; +import org.apache.hadoop.hive.metastore.api.Role; import org.apache.hadoop.hive.metastore.api.SerDeInfo; import org.apache.hadoop.hive.metastore.api.StorageDescriptor; import org.apache.hadoop.hive.metastore.api.Table; @@ -62,6 +66,12 @@ import org.apache.hadoop.hive.metastore.model.MIndex; import org.apache.hadoop.hive.metastore.model.MOrder; import org.apache.hadoop.hive.metastore.model.MPartition; +import org.apache.hadoop.hive.metastore.model.MSecurityColumn; +import org.apache.hadoop.hive.metastore.model.MSecurityDB; +import org.apache.hadoop.hive.metastore.model.MSecurityRoleEntity; +import org.apache.hadoop.hive.metastore.model.MSecurityTablePartition; +import org.apache.hadoop.hive.metastore.model.MSecurityUser; +import org.apache.hadoop.hive.metastore.model.MSecurityUserRoleMap; import org.apache.hadoop.hive.metastore.model.MSerDeInfo; import org.apache.hadoop.hive.metastore.model.MStorageDescriptor; import org.apache.hadoop.hive.metastore.model.MTable; @@ -651,7 +661,7 @@ .getRetention(), convertToStorageDescriptor(mtbl.getSd()), convertToFieldSchemas(mtbl.getPartitionKeys()), mtbl.getParameters(), mtbl.getViewOriginalText(), mtbl.getViewExpandedText(), - tableType); + tableType, null); } private MTable convertToMTable(Table tbl) throws InvalidObjectException, @@ -863,7 +873,7 @@ return new Partition(mpart.getValues(), mpart.getTable().getDatabase() .getName(), mpart.getTable().getTableName(), mpart.getCreateTime(), mpart.getLastAccessTime(), convertToStorageDescriptor(mpart.getSd()), - mpart.getParameters()); + mpart.getParameters(), null); } public boolean dropPartition(String dbName, String tableName, @@ -1395,4 +1405,1165 @@ } return pns; } + + @Override + public boolean addRole(String roleName, String ownerName) throws InvalidObjectException, + MetaException { + boolean success = false; + boolean commited = false; + try { + openTransaction(); + MSecurityRoleEntity nameCheck = this.getMRole(roleName); + if (nameCheck != null) { + throw new RuntimeException("Role " + roleName + " already exists."); + } + int now = (int)(System.currentTimeMillis()/1000); + MSecurityRoleEntity mRole = new MSecurityRoleEntity(roleName, now, + ownerName); + pm.makePersistent(mRole); + commited = commitTransaction(); + success = true; + } finally { + if (!commited) { + rollbackTransaction(); + } + } + return success; + } + + @Override + public boolean addRoleMember(Role role, String userName, boolean isRole, + boolean isGroup) throws MetaException, NoSuchObjectException { + boolean success = false; + boolean commited = false; + try { + openTransaction(); + MSecurityRoleEntity mRole = getMRole(role.getRoleName()); + long now = System.currentTimeMillis()/1000; + MSecurityUserRoleMap roleMember = new MSecurityUserRoleMap(userName, + isRole, isGroup, mRole, (int) now); + pm.makePersistent(roleMember); + commited = commitTransaction(); + success = true; + } finally { + if (!commited) { + rollbackTransaction(); + } + } + return success; + } + + @Override + public boolean removeRoleMember(Role role, String userName, boolean isRole, + boolean isGroup) throws MetaException, NoSuchObjectException { + boolean success = false; + try { + openTransaction(); + MSecurityUserRoleMap roleMember = getMSecurityUserRoleMap(userName, isRole, isGroup, role.getRoleName()); + pm.deletePersistent(roleMember); + success = commitTransaction(); + } finally { + if (!success) { + rollbackTransaction(); + } + } + return success; + } + + @Override + public boolean removeRole(String roleName) throws MetaException, + NoSuchObjectException { + boolean success = false; + try { + openTransaction(); + MSecurityRoleEntity mRol = getMRole(roleName); + pm.retrieve(mRol); + if (mRol != null) { + // first remove all the membership, the membership that this role has + // been granted + List roleMap = listMSecurityUserRoleMember(mRol); + if (roleMap.size() > 0) { + pm.deletePersistentAll(roleMap); + } + List roleMember = listMSecurityPrincipalMembershipRole( + mRol.getRoleName(), true, false); + if (roleMember.size() > 0) { + pm.deletePersistentAll(roleMember); + } + // then remove all the grants + List userGrants = listMSecurityPrincipalUserGrant( + mRol.getRoleName(), true, false); + if (userGrants.size() > 0) { + pm.deletePersistentAll(userGrants); + } + List dbGrants = listAllMSecurityPrincipalDBGrant( + mRol.getRoleName(), true, false); + if (dbGrants.size() > 0) { + pm.deletePersistentAll(dbGrants); + } + List tabPartGrants = listAllMSecurityPrincipalTablePartGrant( + mRol.getRoleName(), true, false); + if (tabPartGrants.size() > 0) { + pm.deletePersistentAll(tabPartGrants); + } + List columnGrants = listAllMSecurityPrincipalColumnGrant( + mRol.getRoleName(), true, false); + if (columnGrants.size() > 0) { + pm.deletePersistentAll(columnGrants); + } + // last remove the role + pm.deletePersistent(mRol); + } + success = commitTransaction(); + } finally { + if (!success) { + rollbackTransaction(); + } + } + return success; + } + + @SuppressWarnings("unchecked") + private List listMSecurityPrincipalMembershipRole(final String roleName, + final boolean isRole, final boolean isGroup) { + boolean success = false; + List mRoleMemebership = null; + try { + openTransaction(); + LOG.debug("Executing listMSecurityPrincipalMembershipRole"); + Query query = pm.newQuery(MSecurityUserRoleMap.class, + "principalName == t1 && isRole == t2 && isGroup == t3"); + query + .declareParameters("java.lang.String t1, java.lang.Boolean t2, java.lang.Boolean t3"); + mRoleMemebership = (List) query.execute(roleName, + isRole, isGroup); + LOG + .debug("Done executing query for listMSecurityPrincipalMembershipRole"); + pm.retrieveAll(mRoleMemebership); + success = commitTransaction(); + LOG + .debug("Done retrieving all objects for listMSecurityPrincipalMembershipRole"); + } finally { + if (!success) { + rollbackTransaction(); + } + } + return mRoleMemebership; + } + + public Role getRole(String roleName) throws NoSuchObjectException { + MSecurityRoleEntity mRole = this.getMRole(roleName); + if (mRole == null) { + throw new NoSuchObjectException(roleName + " role can not be found."); + } + Role ret = new Role(mRole.getRoleName(), mRole.getCreateTime(), mRole + .getOwnerName()); + return ret; + } + + private MSecurityRoleEntity getMRole(String roleName) { + MSecurityRoleEntity mrole = null; + boolean commited = false; + try { + openTransaction(); + Query query = pm.newQuery(MSecurityRoleEntity.class, "roleName == t1"); + query.declareParameters("java.lang.String t1"); + query.setUnique(true); + mrole = (MSecurityRoleEntity) query.execute(roleName); + pm.retrieve(mrole); + commited = commitTransaction(); + } finally { + if (!commited) { + rollbackTransaction(); + } + } + return mrole; + } + + private MSecurityUserRoleMap getMSecurityUserRoleMap(String userName, + boolean isRole, boolean isGroup, String roleName) { + MSecurityUserRoleMap mRoleMember = null; + boolean commited = false; + try { + openTransaction(); + Query query = pm.newQuery(MSecurityUserRoleMap.class, "principalName == t1, isRole==t2, isGroup == t3, role.roleName == t4"); + query.declareParameters("java.lang.String t1, java.lang.Boolean t2, java.lang.Boolean t3, java.lang.String t4"); + query.setUnique(true); + mRoleMember = (MSecurityUserRoleMap) query.executeWithArray(userName, isRole, isGroup, roleName); + pm.retrieve(mRoleMember); + commited = commitTransaction(); + } finally { + if (!commited) { + rollbackTransaction(); + } + } + return mRoleMember; + } + + @Override + public PrincipalPrivilegeSet getUserPrivilegeSet(String userName, + List groupNames) throws InvalidObjectException, MetaException { + boolean commited = false; + PrincipalPrivilegeSet ret = new PrincipalPrivilegeSet(); + try { + openTransaction(); + if (userName != null) { + List user = this.listMSecurityPrincipalUserGrant(userName, false, false); + if(user.size()>0) { + Map userPriv = new HashMap(); + String userPrivStr = user.get(0).getPrivileges(); + for (int i = 1; i < user.size(); i++) { + userPrivStr = userPrivStr + ";" + user.get(i).getPrivileges(); + } + userPriv.put(userName, userPrivStr); + ret.setUserPrivileges(userPriv); + } + } + if (groupNames != null && groupNames.size() > 0) { + Map groupPriv = new HashMap(); + for(String groupName: groupNames) { + List group = this.listMSecurityPrincipalUserGrant(groupName, false, true); + if(group.size()>0) { + String groupPrivStr = group.get(0).getPrivileges(); + for (int i = 1; i < group.size(); i++) { + groupPrivStr = groupPrivStr + ";" + group.get(i).getPrivileges(); + } + groupPriv.put(groupName, groupPrivStr); + } + } + ret.setGroupPrivileges(groupPriv); + } + List roles = listRoles(userName, groupNames); + if (roles != null && roles.size() > 0) { + Map rolePrivs = new HashMap(); + for(MSecurityUserRoleMap role: roles) { + List roleUserPrivs = this.listMSecurityPrincipalUserGrant(role.getRole().getRoleName(), true, false); + if(roleUserPrivs.size()>0) { + String rolePrivStr = roleUserPrivs.get(0).getPrivileges(); + for (int i = 1; i < roleUserPrivs.size(); i++) { + rolePrivStr = rolePrivStr + ";" + roleUserPrivs.get(i).getPrivileges(); + } + rolePrivs.put(role.getRole().getRoleName(), rolePrivStr); + } + } + ret.setRolePrivileges(rolePrivs); + } + commited = commitTransaction(); + } finally { + if (!commited) { + rollbackTransaction(); + } + } + return ret; + } + + @Override + public PrincipalPrivilegeSet getDBPrivilegeSet(String dbName, + String userName, List groupNames) throws InvalidObjectException, + MetaException { + boolean commited = false; + PrincipalPrivilegeSet ret = new PrincipalPrivilegeSet(); + try { + openTransaction(); + if (userName != null) { + Map userDbPriv = new HashMap(); + userDbPriv.put(userName, getDBPrivilege(dbName, userName, false, false)); + ret.setUserPrivileges(userDbPriv); + } + if (groupNames != null && groupNames.size() > 0) { + Map groupDbPriv = new HashMap(); + for (String groupName : groupNames) { + groupDbPriv.put(groupName, getDBPrivilege(dbName, groupName, false, + true)); + } + ret.setGroupPrivileges(groupDbPriv); + } + List roles = listRoles(userName, groupNames); + if (roles != null && roles.size() > 0) { + Map roleDbPriv = new HashMap(); + for (MSecurityUserRoleMap role : roles) { + String name = role.getPrincipalName(); + roleDbPriv.put(name, getDBPrivilege(dbName, name, true, false)); + } + ret.setRolePrivileges(roleDbPriv); + } + commited = commitTransaction(); + } finally { + if (!commited) { + rollbackTransaction(); + } + } + return ret; + } + + @Override + public PrincipalPrivilegeSet getPartitionPrivilegeSet(String dbName, + String tableName, String partition, String userName, + List groupNames) throws InvalidObjectException, MetaException { + boolean commited = false; + PrincipalPrivilegeSet ret = new PrincipalPrivilegeSet(); + try { + openTransaction(); + if (userName != null) { + Map userPartitionPriv = new HashMap(); + userPartitionPriv.put(userName, getPartitionPrivilege(dbName, + tableName, partition, userName, false, false)); + ret.setUserPrivileges(userPartitionPriv); + } + if (groupNames != null && groupNames.size() > 0) { + Map groupPartitionPriv = new HashMap(); + for (String groupName : groupNames) { + groupPartitionPriv.put(groupName, getPartitionPrivilege(dbName, tableName, + partition, groupName, false, true)); + } + ret.setGroupPrivileges(groupPartitionPriv); + } + List roles = listRoles(userName, groupNames); + if (roles != null && roles.size() > 0) { + Map rolePartPriv = new HashMap(); + for (MSecurityUserRoleMap role : roles) { + String roleName = role.getPrincipalName(); + rolePartPriv.put(roleName, getPartitionPrivilege(dbName, tableName, + partition, roleName, true, false)); + } + ret.setRolePrivileges(rolePartPriv); + } + commited = commitTransaction(); + } finally { + if (!commited) { + rollbackTransaction(); + } + } + return ret; + } + + @Override + public PrincipalPrivilegeSet getTablePrivilegeSet(String dbName, + String tableName, String userName, List groupNames) + throws InvalidObjectException, MetaException { + boolean commited = false; + PrincipalPrivilegeSet ret = new PrincipalPrivilegeSet(); + try { + openTransaction(); + if (userName != null) { + Map userPartitionPriv = new HashMap(); + userPartitionPriv.put(userName, getTablePrivilege(dbName, + tableName, userName, false, false)); + ret.setUserPrivileges(userPartitionPriv); + } + if (groupNames != null && groupNames.size() > 0) { + Map groupPartitionPriv = new HashMap(); + for (String groupName : groupNames) { + groupPartitionPriv.put(groupName, getTablePrivilege(dbName, tableName, + groupName, false, true)); + } + ret.setGroupPrivileges(groupPartitionPriv); + } + List roles = listRoles(userName, groupNames); + if (roles != null && roles.size() > 0) { + Map rolePartPriv = new HashMap(); + for (MSecurityUserRoleMap role : roles) { + String roleName = role.getPrincipalName(); + rolePartPriv.put(roleName, getTablePrivilege(dbName, tableName, + roleName, true, false)); + } + ret.setRolePrivileges(rolePartPriv); + } + commited = commitTransaction(); + } finally { + if (!commited) { + rollbackTransaction(); + } + } + return ret; + } + + @Override + public PrincipalPrivilegeSet getColumnPrivilegeSet(String dbName, + String tableName, String partitionName, String columnName, + String userName, List groupNames) throws InvalidObjectException, + MetaException { + boolean commited = false; + PrincipalPrivilegeSet ret = new PrincipalPrivilegeSet(); + try { + openTransaction(); + if (userName != null) { + Map userPartitionPriv = new HashMap(); + userPartitionPriv.put(userName, getColumnPrivilege(dbName, tableName, + columnName, userName, false, false)); + ret.setUserPrivileges(userPartitionPriv); + } + if (groupNames != null && groupNames.size() > 0) { + Map groupPartitionPriv = new HashMap(); + for (String groupName : groupNames) { + groupPartitionPriv.put(groupName, getColumnPrivilege(dbName, tableName,columnName, + groupName, false, true)); + } + ret.setGroupPrivileges(groupPartitionPriv); + } + List roles = listRoles(userName, groupNames); + if (roles != null && roles.size() > 0) { + Map rolePartPriv = new HashMap(); + for (MSecurityUserRoleMap role : roles) { + String roleName = role.getPrincipalName(); + rolePartPriv.put(roleName, getColumnPrivilege(dbName, tableName,columnName, + roleName, true, false)); + } + ret.setRolePrivileges(rolePartPriv); + } + commited = commitTransaction(); + } finally { + if (!commited) { + rollbackTransaction(); + } + } + return ret; + } + + @Override + public boolean grantPrivileges(String userName, boolean isRole, + boolean isGroup, PrivilegeBag privileges, String grantor) + throws InvalidObjectException, MetaException, NoSuchObjectException { + boolean committed = false; + int now = (int)(System.currentTimeMillis()/1000); + try { + openTransaction(); + List persistentObjs = new ArrayList(); + + String userPrivs = privileges.getUserPrivileges(); + if (userPrivs != null) { + MSecurityUser mDb = new MSecurityUser(userName, isRole, isGroup, + userPrivs, now, grantor); + persistentObjs.add(mDb); + } + + Map dbPrivs = privileges.getDbPrivileges(); + if (dbPrivs != null) { + for (Map.Entry db : dbPrivs.entrySet()) { + MDatabase dbObj = getMDatabase(db.getKey().getName()); + if (dbObj != null) { + MSecurityDB mDb = new MSecurityDB(userName, isRole, isGroup, dbObj, + db.getValue(), now, grantor); + persistentObjs.add(mDb); + } + } + } + + Map tablePriv = privileges.getTablePrivileges(); + if (tablePriv != null) { + for (Map.Entry table : tablePriv.entrySet()) { + MTable tblObj = getMTable(table.getKey().getDbName(), table.getKey() + .getTableName()); + if (tblObj != null) { + MSecurityTablePartition mTab = new MSecurityTablePartition( + userName, isRole, isGroup, tblObj, null, table.getValue(), now, + grantor); + persistentObjs.add(mTab); + } + } + } + + Map partitionPriv = privileges.getPartitionPrivileges(); + if (partitionPriv != null) { + for (Map.Entry part : partitionPriv.entrySet()) { + Partition partObj = part.getKey(); + MPartition tblObj = this.getMPartition(partObj.getDbName(), partObj + .getTableName(), partObj.getValues()); + if (tblObj != null) { + MSecurityTablePartition mTab = new MSecurityTablePartition( + userName, isRole, isGroup, tblObj.getTable(), tblObj, part + .getValue(), now, grantor); + persistentObjs.add(mTab); + } + } + } + + List columnPriv = privileges.getColumnPrivileges(); + if (columnPriv != null) { + for (ColumnPrivilegeBag col : columnPriv) { + Map columnMap = col.getColumnPrivileges(); + MTable tblObj = getMTable(col.getDbName(), col.getTableName()); + if (columnMap != null && tblObj != null) { + for (Map.Entry colPriv : columnMap.entrySet()) { + MSecurityColumn mCol = new MSecurityColumn(userName, isRole, + isGroup, tblObj, colPriv.getKey(), colPriv.getValue(), now, + grantor); + persistentObjs.add(mCol); + } + } + } + } + if (persistentObjs.size() > 0) { + pm.makePersistentAll(persistentObjs); + } + committed = commitTransaction(); + } finally { + if (!committed) { + rollbackTransaction(); + } + } + return committed; + } + + public boolean revokeAllPrivileges(String userName, boolean isRole, + boolean isGroup, boolean removeUserPriv, List dbs, + List
tables, List parts, + Map> columns) throws MetaException { + boolean committed = false; + try { + openTransaction(); + List persistentObjs = new ArrayList(); + if (removeUserPriv) { + List mSecUser = this.listMSecurityPrincipalUserGrant( + userName, isRole, isGroup); + if (mSecUser != null) { + persistentObjs.addAll(persistentObjs); + } + } + + if (dbs != null) { + for (Database db : dbs) { + List dbGrants = this.listMSecurityPrincipalDBGrant( + userName, isGroup, isRole, db.getName()); + persistentObjs.addAll(dbGrants); + } + } + + if(tables != null) { + for (Table tab : tables) { + List tabGrants = + this.listMSecurityPrincipalTableGrant(userName, isGroup, isRole, + tab.getDbName(), tab.getTableName()); + persistentObjs.addAll(tabGrants); + } + } + + if(parts != null) { + for (Partition part : parts) { + Table tabObj = this.getTable(part.getDbName(), part.getTableName()); + List partGrants = this + .listMSecurityPrincipalPartitionGrant(userName, isGroup, isRole, + part.getDbName(), part.getTableName(), + Warehouse.makePartName(tabObj.getPartitionKeys(), part.getValues())); + persistentObjs.addAll(partGrants); + } + } + + if(columns != null) { + for (Map.Entry> tableColMap : columns.entrySet()){ + Table table = tableColMap.getKey(); + List colList = tableColMap.getValue(); + for(String col : colList) { + List secCol = this.listMSecurityPrincipalColumnGrant(userName, isGroup, isRole, + table.getDbName(), table.getTableName(), col); + persistentObjs.addAll(secCol); + } + } + } + + if (persistentObjs.size() > 0) { + pm.deletePersistentAll(persistentObjs); + } + committed = commitTransaction(); + } finally { + if (!committed) { + rollbackTransaction(); + } + } + return committed; + } + + @Override + public boolean revokePrivileges(String userName, boolean isRole, + boolean isGroup, PrivilegeBag privileges) throws InvalidObjectException, + MetaException { + boolean committed = false; + try { + openTransaction(); + List persistentObjs = new ArrayList(); + String userPriv = privileges.getUserPrivileges(); + if (userPriv != null && !userPriv.trim().equals("")) { + List mSecUser = this.listMSecurityPrincipalUserGrant( + userName, isRole, isGroup); + boolean found = false; + if (mSecUser != null) { + String[] userPrivArray = userPriv.split(","); + for (MSecurityUser userGrant : mSecUser) { + String[] userGrantArray = userGrant.getPrivileges().split(","); + if (stringArrayEqualsIgnoreOrder(userPrivArray, userGrantArray)) { + found = true; + persistentObjs.add(userGrant); + break; + } + } + if (!found) { + throw new InvalidObjectException( + "No user grant found for privileges " + userPriv); + } + } + } + + Map dbPrivileges = privileges.getDbPrivileges(); + if (dbPrivileges != null) { + for (Map.Entry dbPriv : dbPrivileges.entrySet()) { + Database db = dbPriv.getKey(); + String dbPrivStr = dbPriv.getValue(); + boolean found = false; + String[] dbPrivArray = dbPrivStr.split(","); + List dbGrants = this.listMSecurityPrincipalDBGrant( + userName, isGroup, isRole, db.getName()); + for (MSecurityDB dbGrant : dbGrants) { + String[] privStrArray = dbGrant.getPrivileges().split(","); + if (stringArrayEqualsIgnoreOrder(dbPrivArray, privStrArray)) { + found = true; + persistentObjs.add(dbGrant); + break; + } + } + if (!found) { + throw new InvalidObjectException( + "No database grant found for privileges " + dbPrivStr + + " on database " + db.getName()); + } + } + } + + Map tablePrivileges = privileges.getTablePrivileges(); + if (tablePrivileges != null) { + for (Map.Entry tabPriv : tablePrivileges.entrySet()) { + Table table = tabPriv.getKey(); + String tblPrivStr = tabPriv.getValue(); + boolean found = false; + String[] tablePrivArray = tblPrivStr.split(","); + List tableGrants = + this.listMSecurityPrincipalTableGrant(userName, isGroup, isRole, + table.getDbName(), table.getTableName()); + for (MSecurityTablePartition tabGrant : tableGrants) { + String[] privStrArray = tabGrant.getPrivileges().split(","); + if (stringArrayEqualsIgnoreOrder(privStrArray, tablePrivArray)) { + found = true; + persistentObjs.add(tabGrant); + break; + } + } + if (!found) { + throw new InvalidObjectException("No grant (" + tblPrivStr + + ") found " + " on table " + table.getTableName() + + ", database is " + table.getDbName()); + } + } + } + + Map partPrivileges = privileges + .getPartitionPrivileges(); + if (partPrivileges != null) { + for (Map.Entry partPriv : partPrivileges.entrySet()) { + Partition part = partPriv.getKey(); + String partPrivStr = partPriv.getValue(); + boolean found = false; + String[] partPrivArray = partPrivStr.split(","); + Table tabObj = this.getTable(part.getDbName(), part.getTableName()); + List partitionGrants = + this.listMSecurityPrincipalPartitionGrant(userName, isGroup, isRole, + part.getTableName(), part.getDbName(), + Warehouse.makePartName(tabObj.getPartitionKeys(), part.getValues())); + for (MSecurityTablePartition tabGrant : partitionGrants) { + String[] privStrArray = tabGrant.getPrivileges().split(","); + if (stringArrayEqualsIgnoreOrder(privStrArray, partPrivArray)) { + found = true; + persistentObjs.add(tabGrant); + break; + } + } + if (!found) { + throw new InvalidObjectException("No grant (" + partPrivStr + + ") found " + " on table " + tabObj.getTableName() + + ", database is " + tabObj.getDbName()); + } + } + } + + List columnPrivileges = privileges + .getColumnPrivileges(); + if (columnPrivileges != null) { + for (ColumnPrivilegeBag colPriv : columnPrivileges) { + String dbName = colPriv.getDbName(); + String tabName = colPriv.getTableName(); + Map colPrivMap = colPriv.getColumnPrivileges(); + for (Map.Entry column : colPrivMap.entrySet()) { + List mSecCol = this.listMSecurityPrincipalColumnGrant( + userName, isGroup, isRole, dbName, tabName, column.getKey()); + boolean found = false; + if (mSecCol != null) { + String[] toBeMatched = column.getValue().split(","); + for (MSecurityColumn col : mSecCol) { + String[] candicate = col.getPrivileges().split(","); + if (stringArrayEqualsIgnoreOrder(candicate, toBeMatched)) { + found = true; + persistentObjs.add(col); + break; + } + } + if (!found) { + throw new InvalidObjectException("No grant (" + column + + ") found " + " on column " + column.getKey() + " table " + + tabName + ", database is " + dbName); + } + } + } + } + } + if (persistentObjs.size() > 0) { + pm.deletePersistentAll(persistentObjs); + } + committed = commitTransaction(); + } finally { + if (!committed) { + rollbackTransaction(); + } + } + return committed; + } + + private boolean stringArrayEqualsIgnoreOrder(String[] o1, String[] o2) { + if (o1 == o2) { + return true; + } + if (o1 != null && o2 != null) { + for (int i = 0; i < o1.length; i++) { + boolean found = false; + for (int j = 0; j < o2.length; j++) { + if (o1[i].equalsIgnoreCase(o2[j])) { + found = true; + break; + } + } + + if (!found) { + return false; + } + } + return true; + } else { + return false; + } + } + + private List listRoles(String userName, List groupNames) { + List ret = new ArrayList(); + if(userName != null) { + ret.addAll(listRoles(userName, false, false)); + } + if (groupNames != null) { + for (String groupName: groupNames) { + ret.addAll(listRoles(groupName, false, true)); + } + } + return ret; + } + + @SuppressWarnings("unchecked") + private List listRoles(String principalName, + boolean isRole, boolean isGroup) { + boolean success = false; + List mRoleMember = null; + try { + openTransaction(); + LOG.debug("Executing listRoles"); + Query query = pm.newQuery(MSecurityUserRoleMap.class, + "principalName == t1 && isGroup == t2 && isRole == t3"); + query + .declareParameters("java.lang.String t1, java.lang.Boolean t2, java.lang.Boolean t3"); + mRoleMember = (List) query.execute(principalName, + isGroup, isRole); + LOG.debug("Done executing query for listMSecurityUserRoleMap"); + pm.retrieveAll(mRoleMember); + success = commitTransaction(); + LOG.debug("Done retrieving all objects for listMSecurityUserRoleMap"); + } finally { + if (!success) { + rollbackTransaction(); + } + } + return mRoleMember; + } + + @SuppressWarnings("unchecked") + public String getDBPrivilege(String dbName, + String principlaName, boolean isRole, boolean isGroup) + throws InvalidObjectException, MetaException { + boolean commited = false; + String privileges = null; + try { + openTransaction(); + if (principlaName != null) { + Query query = pm.newQuery(MSecurityDB.class, + "database.name == t1 && principalName == t2 && isRole == t3 && isGroup== t4"); + query.declareParameters( + "java.lang.String t1, java.lang.String t2, java.lang.Boolean t3, java.lang.Boolean t4"); + List userNameDbPriv = (List) query + .executeWithArray(dbName, principlaName, isRole, isGroup); + pm.retrieveAll(userNameDbPriv); + if (userNameDbPriv != null && userNameDbPriv.size() > 0) { + privileges = userNameDbPriv.get(0).getPrivileges(); + for (int i = 1; i < userNameDbPriv.size(); i++) { + privileges = privileges + "," + + userNameDbPriv.get(i).getPrivileges(); + } + } + } + commited = commitTransaction(); + } finally { + if (!commited) { + rollbackTransaction(); + } + } + return privileges; + } + + @SuppressWarnings("unchecked") + private String getTablePrivilege(String dbName, String tableName, + String principalName, boolean isRole, boolean isGroup) { + boolean commited = false; + String privileges = null; + try { + openTransaction(); + if (principalName != null) { + Query query = pm.newQuery(MSecurityTablePartition.class, + "table.database.name == t1 && tableName == t2 " + + "&& principalName == t3 && isRole == t4 && isGroup== t5"); + query + .declareParameters("java.lang.String t1, java.lang.String t2, java.lang.String t3, " + + "java.lang.Boolean t4, java.lang.Boolean t5"); + List userNameTabPartPriv = (List) query + .executeWithArray(dbName, tableName, principalName, isRole, isGroup); + pm.retrieveAll(userNameTabPartPriv); + if (userNameTabPartPriv != null && userNameTabPartPriv.size() > 0) { + privileges = userNameTabPartPriv.get(0).getPrivileges(); + for (int i = 1; i < userNameTabPartPriv.size(); i++) { + privileges = privileges + "," + + userNameTabPartPriv.get(i).getPrivileges(); + } + } + } + commited = commitTransaction(); + } finally { + if (!commited) { + rollbackTransaction(); + } + } + return privileges; + } + + @SuppressWarnings("unchecked") + private String getPartitionPrivilege(String dbName, String principalName, + String tableName, String partName, boolean isRole, boolean isGroup) { + boolean commited = false; + String privileges = null; + try { + openTransaction(); + if (principalName != null) { + Query query = pm.newQuery( + MSecurityTablePartition.class, + "table.database.name == t1 && table.tableName == t2 && partition.partitionName == t3 " + + "&& principalName == t4 && isRole == t5 && isGroup== t6"); + query.declareParameters( + "java.lang.String t1, java.lang.String t2, java.lang.String t3, java.lang.String t4, " + + "java.lang.Boolean t5, java.lang.Boolean t6"); + List userNameTabPartPriv = (List) query + .executeWithArray(dbName, tableName, partName, principalName, + isRole, isGroup); + pm.retrieveAll(userNameTabPartPriv); + if (userNameTabPartPriv != null && userNameTabPartPriv.size() > 0) { + privileges = userNameTabPartPriv.get(0).getPrivileges(); + for (int i = 1; i < userNameTabPartPriv.size(); i++) { + privileges = privileges + "," + + userNameTabPartPriv.get(i).getPrivileges(); + } + } + } + commited = commitTransaction(); + } finally { + if (!commited) { + rollbackTransaction(); + } + } + return privileges; + } + + @SuppressWarnings("unchecked") + private String getColumnPrivilege(String dbName, String tableName, + String columnName, String principalName, boolean isRole, boolean isGroup) { + boolean commited = false; + String privileges = null; + try { + openTransaction(); + if (principalName != null) { + Query query = pm.newQuery(MSecurityColumn.class, + "table.database.name == t1 && table.tableName == t2 && columnName == t3 " + + "&& principalName == t4 && isRole == t5 && isGroup== t6"); + query.declareParameters("java.lang.String t1, java.lang.String t2, java.lang.String t3, " + + "java.lang.String t4, java.lang.Boolean t5, java.lang.Boolean t6"); + List userNameTabPartPriv = (List) query + .executeWithArray(dbName, tableName, columnName, principalName, + isRole, isGroup); + pm.retrieveAll(userNameTabPartPriv); + if (userNameTabPartPriv != null && userNameTabPartPriv.size() > 0) { + privileges = userNameTabPartPriv.get(0).getPrivileges(); + for (int i = 1; i < userNameTabPartPriv.size(); i++) { + privileges = privileges + "," + + userNameTabPartPriv.get(i).getPrivileges(); + } + } + } + commited = commitTransaction(); + } finally { + if (!commited) { + rollbackTransaction(); + } + } + return privileges; + } + + @SuppressWarnings("unchecked") + private List listMSecurityUserRoleMember( + MSecurityRoleEntity mRol) { + boolean success = false; + List mRoleMemeberList = null; + try { + openTransaction(); + LOG.debug("Executing listMSecurityUserRoleMember"); + Query query = pm.newQuery(MSecurityUserRoleMap.class, + "role.roleName == t1"); + query.declareParameters("java.lang.String t1"); + query.setUnique(false); + mRoleMemeberList = (List) query.execute( + mRol.getRoleName()); + LOG.debug("Done executing query for listMSecurityUserRoleMember"); + pm.retrieveAll(mRoleMemeberList); + success = commitTransaction(); + LOG.debug("Done retrieving all objects for listMSecurityUserRoleMember"); + } finally { + if (!success) { + rollbackTransaction(); + } + } + return mRoleMemeberList; + } + + @SuppressWarnings("unchecked") + public List listMSecurityPrincipalUserGrant(String principlaName, + boolean isRole, boolean isGroup) { + boolean commited = false; + List userNameDbPriv = null; + try { + openTransaction(); + if (principlaName != null) { + Query query = pm.newQuery(MSecurityUser.class, + "principalName == t1 && isRole == t2 && isGroup== t3"); + query.declareParameters( + "java.lang.String t1, java.lang.Boolean t2, java.lang.Boolean t3"); + userNameDbPriv = (List) query + .executeWithArray(principlaName, isRole, isGroup); + pm.retrieveAll(userNameDbPriv); + } + commited = commitTransaction(); + } finally { + if (!commited) { + rollbackTransaction(); + } + } + return userNameDbPriv; + } + + @SuppressWarnings("unchecked") + public List listMSecurityPrincipalDBGrant(String principalName, + boolean isGroup, boolean isRole, String dbName) { + boolean success = false; + List mSecurityDBList = null; + try { + openTransaction(); + LOG.debug("Executing listMSecurityPrincipalDBGrant"); + Query query = pm.newQuery(MSecurityDB.class, + "principalName == t1 && isGroup == t2 && isRole == t3 && database.name == t4"); + query + .declareParameters("java.lang.String t1, java.lang.Boolean t2, java.lang.Boolean t3, java.lang.String t4"); + mSecurityDBList = (List) query.executeWithArray(principalName, + isGroup, isRole, dbName); + LOG.debug("Done executing query for listMSecurityPrincipalDBGrant"); + pm.retrieveAll(mSecurityDBList); + success = commitTransaction(); + LOG.debug("Done retrieving all objects for listMSecurityPrincipalDBGrant"); + } finally { + if (!success) { + rollbackTransaction(); + } + } + return mSecurityDBList; + } + + @SuppressWarnings("unchecked") + private List listAllMSecurityPrincipalDBGrant(String principalName, + boolean isGroup, boolean isRole) { + boolean success = false; + List mSecurityDBList = null; + try { + openTransaction(); + LOG.debug("Executing listAllMSecurityPrincipalDBGrant"); + Query query = pm.newQuery(MSecurityDB.class, + "principalName == t1 && isGroup == t2 && isRole == t3"); + query + .declareParameters("java.lang.String t1, java.lang.Boolean t2, java.lang.Boolean t3"); + mSecurityDBList = (List) query.execute(principalName, + isGroup, isRole); + LOG.debug("Done executing query for listAllMSecurityPrincipalDBGrant"); + pm.retrieveAll(mSecurityDBList); + success = commitTransaction(); + LOG.debug("Done retrieving all objects for listAllMSecurityPrincipalDBGrant"); + } finally { + if (!success) { + rollbackTransaction(); + } + } + return mSecurityDBList; + } + + @SuppressWarnings("unchecked") + public List listMSecurityPrincipalTableGrant( + String principalName, boolean isGroup, boolean isRole, String dbName, + String tableName) { + boolean success = false; + List mSecurityTabPartList = null; + try { + openTransaction(); + LOG.debug("Executing listMSecurityPrincipalTableGrant"); + Query query = pm.newQuery( + MSecurityTablePartition.class, + "principalName == t1 && isGroup == t2 && isRole == t3 && table.tableName == t4 && table.database.name == t5"); + query.declareParameters( + "java.lang.String t1, java.lang.Boolean t2, java.lang.Boolean t3, java.lang.String t4, java.lang.String t5"); + mSecurityTabPartList = (List) query + .executeWithArray(principalName, isGroup, isRole, tableName, dbName); + LOG.debug("Done executing query for listMSecurityPrincipalTableGrant"); + pm.retrieveAll(mSecurityTabPartList); + success = commitTransaction(); + LOG + .debug("Done retrieving all objects for listMSecurityPrincipalTableGrant"); + } finally { + if (!success) { + rollbackTransaction(); + } + } + return mSecurityTabPartList; + } + + @SuppressWarnings("unchecked") + public List listMSecurityPrincipalPartitionGrant( + String principalName, boolean isGroup, boolean isRole, String dbName, + String tableName, String partName) { + boolean success = false; + List mSecurityTabPartList = null; + try { + openTransaction(); + LOG.debug("Executing listMSecurityPrincipalPartitionGrant"); + Query query = pm.newQuery( + MSecurityTablePartition.class, + "principalName == t1 && isGroup == t2 && isRole == t3 && table.tableName == t4 && table.database.name == t5 && partition.partitionName == t6"); + query.declareParameters( + "java.lang.String t1, java.lang.Boolean t2, java.lang.Boolean t3, java.lang.String t4, java.lang.String t5, java.lang.String t6"); + mSecurityTabPartList = (List) query + .executeWithArray(principalName, isGroup, isRole, tableName, dbName, partName); + LOG.debug("Done executing query for listMSecurityPrincipalPartitionGrant"); + pm.retrieveAll(mSecurityTabPartList); + success = commitTransaction(); + LOG.debug("Done retrieving all objects for listMSecurityPrincipalPartitionGrant"); + } finally { + if (!success) { + rollbackTransaction(); + } + } + return mSecurityTabPartList; + } + + @SuppressWarnings("unchecked") + private List listAllMSecurityPrincipalTablePartGrant( + String principalName, boolean isGroup, boolean isRole) { + boolean success = false; + List mSecurityTabPartList = null; + try { + openTransaction(); + LOG.debug("Executing listAllMSecurityPrincipalTablePartGrant"); + Query query = pm.newQuery(MSecurityTablePartition.class, + "principalName == t1 && isGroup == t2 && isRole == t3"); + query + .declareParameters("java.lang.String t1, java.lang.Boolean t2, java.lang.Boolean t3"); + mSecurityTabPartList = (List) query.execute( + principalName, isGroup, isRole); + LOG.debug("Done executing query for listAllMSecurityPrincipalTablePartGrant"); + pm.retrieveAll(mSecurityTabPartList); + success = commitTransaction(); + LOG.debug("Done retrieving all objects for listAllMSecurityPrincipalTablePartGrant"); + } finally { + if (!success) { + rollbackTransaction(); + } + } + return mSecurityTabPartList; + } + + @SuppressWarnings("unchecked") + public List listMSecurityPrincipalColumnGrant( + String principalName, boolean isGroup, boolean isRole, String dbName, + String tableName, String columnName) { + boolean success = false; + List mSecurityColList = null; + try { + openTransaction(); + LOG.debug("Executing listMSecurityPrincipalColumnGrant"); + Query query = pm.newQuery( + MSecurityColumn.class, + "principalName == t1 && isGroup == t2 && isRole == t3 && table.tableName == t4 && table.database.name == t5 && columnName == t6"); + query.declareParameters( + "java.lang.String t1, java.lang.Boolean t2, java.lang.Boolean t3, java.lang.String t4, java.lang.String t5, java.lang.String t6"); + mSecurityColList = (List) query + .executeWithArray(principalName, isGroup, isRole, tableName, dbName, + columnName); + LOG.debug("Done executing query for listMSecurityPrincipalColumnGrant"); + pm.retrieveAll(mSecurityColList); + success = commitTransaction(); + LOG.debug("Done retrieving all objects for listMSecurityPrincipalColumnGrant"); + } finally { + if (!success) { + rollbackTransaction(); + } + } + return mSecurityColList; + } + + @SuppressWarnings("unchecked") + private List listAllMSecurityPrincipalColumnGrant( + String principalName, boolean isGroup, boolean isRole) { + boolean success = false; + List mSecurityColumnList = null; + try { + openTransaction(); + LOG.debug("Executing listAllMSecurityPrincipalColumnGrant"); + Query query = pm.newQuery(MSecurityColumn.class, + "principalName == t1 && isGroup == t2 && isRole == t3"); + query + .declareParameters("java.lang.String t1, java.lang.Boolean t2, java.lang.Boolean t3"); + mSecurityColumnList = (List) query.execute( + principalName, isGroup, isRole); + LOG.debug("Done executing query for listAllMSecurityPrincipalColumnGrant"); + pm.retrieveAll(mSecurityColumnList); + success = commitTransaction(); + LOG.debug("Done retrieving all objects for listAllMSecurityPrincipalColumnGrant"); + } finally { + if (!success) { + rollbackTransaction(); + } + } + return mSecurityColumnList; + } + } Index: metastore/src/java/org/apache/hadoop/hive/metastore/RawStore.java =================================================================== --- metastore/src/java/org/apache/hadoop/hive/metastore/RawStore.java (revision 1030336) +++ metastore/src/java/org/apache/hadoop/hive/metastore/RawStore.java (working copy) @@ -19,6 +19,7 @@ package org.apache.hadoop.hive.metastore; import java.util.List; +import java.util.Map; import org.apache.hadoop.conf.Configurable; import org.apache.hadoop.hive.metastore.api.Database; @@ -27,8 +28,15 @@ import org.apache.hadoop.hive.metastore.api.MetaException; import org.apache.hadoop.hive.metastore.api.NoSuchObjectException; import org.apache.hadoop.hive.metastore.api.Partition; +import org.apache.hadoop.hive.metastore.api.PrincipalPrivilegeSet; +import org.apache.hadoop.hive.metastore.api.PrivilegeBag; +import org.apache.hadoop.hive.metastore.api.Role; import org.apache.hadoop.hive.metastore.api.Table; import org.apache.hadoop.hive.metastore.api.Type; +import org.apache.hadoop.hive.metastore.model.MSecurityColumn; +import org.apache.hadoop.hive.metastore.model.MSecurityDB; +import org.apache.hadoop.hive.metastore.model.MSecurityTablePartition; +import org.apache.hadoop.hive.metastore.model.MSecurityUser; public interface RawStore extends Configurable { @@ -128,5 +136,61 @@ public abstract List getPartitionsByFilter( String dbName, String tblName, String filter, short maxParts) throws MetaException, NoSuchObjectException; + + public abstract boolean addRole(String rowName, String ownerName) throws InvalidObjectException, MetaException; + + public abstract boolean removeRole(String roleName) throws MetaException, NoSuchObjectException; + + public abstract boolean addRoleMember(Role role, String userName, boolean isRole, boolean isGroup) + throws MetaException, NoSuchObjectException; + + public abstract boolean removeRoleMember(Role role, String userName, boolean isRole, boolean isGroup) + throws MetaException, NoSuchObjectException; + + public abstract PrincipalPrivilegeSet getUserPrivilegeSet(String userName, + List groupNames) throws InvalidObjectException, MetaException; + + public abstract PrincipalPrivilegeSet getDBPrivilegeSet (String dbName, String userName, + List groupNames) throws InvalidObjectException, MetaException; + + public abstract PrincipalPrivilegeSet getTablePrivilegeSet (String dbName, String tableName, + String userName, List groupNames) throws InvalidObjectException, MetaException; + + public abstract PrincipalPrivilegeSet getPartitionPrivilegeSet (String dbName, String tableName, + String partition, String userName, List groupNames) throws InvalidObjectException, MetaException; + + public abstract PrincipalPrivilegeSet getColumnPrivilegeSet (String dbName, String tableName, String partitionName, + String columnName, String userName, List groupNames) throws InvalidObjectException, MetaException; + + public abstract List listMSecurityPrincipalUserGrant(String principlaName, + boolean isRole, boolean isGroup); + + public abstract List listMSecurityPrincipalDBGrant(String principalName, + boolean isGroup, boolean isRole, String dbName); + + public abstract List listMSecurityPrincipalTableGrant( + String principalName, boolean isGroup, boolean isRole, String dbName, + String tableName); + + public abstract List listMSecurityPrincipalPartitionGrant( + String principalName, boolean isGroup, boolean isRole, String dbName, + String tableName, String partName); + + public abstract List listMSecurityPrincipalColumnGrant( + String principalName, boolean isGroup, boolean isRole, String dbName, + String tableName, String columnName); + + public abstract boolean grantPrivileges (String userName, boolean isRole, boolean isGroup, PrivilegeBag privileges, String grantor) + throws InvalidObjectException, MetaException, NoSuchObjectException; + + public abstract boolean revokePrivileges (String userName, boolean isRole, boolean isGroup, PrivilegeBag privileges) + throws InvalidObjectException, MetaException; + + public abstract org.apache.hadoop.hive.metastore.api.Role getRole(String roleName) throws NoSuchObjectException; + + public boolean revokeAllPrivileges(String userName, boolean isRole, + boolean isGroup, boolean removeUserPriv, List dbs, + List
tables, List parts, + Map> columns) throws MetaException; } Index: metastore/src/model/package.jdo =================================================================== --- metastore/src/model/package.jdo (revision 1030336) +++ metastore/src/model/package.jdo (working copy) @@ -298,13 +298,13 @@ - + - + @@ -345,5 +345,182 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Index: metastore/src/model/org/apache/hadoop/hive/metastore/model/MSecurityColumn.java =================================================================== --- metastore/src/model/org/apache/hadoop/hive/metastore/model/MSecurityColumn.java (revision 0) +++ metastore/src/model/org/apache/hadoop/hive/metastore/model/MSecurityColumn.java (revision 0) @@ -0,0 +1,158 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.hadoop.hive.metastore.model; + +public class MSecurityColumn { + + private String principalName; + + private boolean isRole; + + private boolean isGroup; + + private MTable table; + + private String columnName; + + private String privileges; + + private int createTime; + + private String grantor; + + public MSecurityColumn() { + } + + public MSecurityColumn(String principalName, boolean isRole, boolean isGroup, + MTable table, String columnName, String privileges, int createTime, + String grantor) { + super(); + this.principalName = principalName; + this.isRole = isRole; + this.isGroup = isGroup; + this.table = table; + this.columnName = columnName; + this.privileges = privileges; + this.createTime = createTime; + this.grantor = grantor; + } + + /** + * @return true if this user name is a role + */ + public boolean getIsRole() { + return isRole; + } + + /** + * @param isRole is this user name a role? + */ + public void setIsRole(boolean isRole) { + this.isRole = isRole; + } + + /** + * @return true if this user name is a group, false else + */ + public boolean getIsGroup() { + return isGroup; + } + + /** + * @param isGroup true if is this user name a group + */ + public void setIsGroup(boolean isGroup) { + this.isGroup = isGroup; + } + + /** + * @return column name + */ + public String getColumnName() { + return columnName; + } + + /** + * @param columnName column name + */ + public void setColumnName(String columnName) { + this.columnName = columnName; + } + + /** + * @return a set of privileges this user/role/group has + */ + public String getPrivileges() { + return privileges; + } + + /** + * @param dbPrivileges a set of privileges this user/role/group has + */ + public void setPrivileges(String dbPrivileges) { + this.privileges = dbPrivileges; + } + + /** + * @return create time + */ + public int getCreateTime() { + return createTime; + } + + /** + * @param createTime create time + */ + public void setCreateTime(int createTime) { + this.createTime = createTime; + } + + public String getPrincipalName() { + return principalName; + } + + public void setPrincipalName(String principalName) { + this.principalName = principalName; + } + + public MTable getTable() { + return table; + } + + public void setTable(MTable table) { + this.table = table; + } + + public void setRole(boolean isRole) { + this.isRole = isRole; + } + + public void setGroup(boolean isGroup) { + this.isGroup = isGroup; + } + + public String getGrantor() { + return grantor; + } + + public void setGrantor(String grantor) { + this.grantor = grantor; + } + +} Index: metastore/src/model/org/apache/hadoop/hive/metastore/model/MSecurityDB.java =================================================================== --- metastore/src/model/org/apache/hadoop/hive/metastore/model/MSecurityDB.java (revision 0) +++ metastore/src/model/org/apache/hadoop/hive/metastore/model/MSecurityDB.java (revision 0) @@ -0,0 +1,140 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.hadoop.hive.metastore.model; + +public class MSecurityDB { + + private String principalName; + + private boolean isRole; + + private boolean isGroup; + + private MDatabase database; + + private int createTime; + + private String privileges; + + private String grantor; + + public MSecurityDB() { + } + + public MSecurityDB(String principalName, boolean isRole, boolean isGroup, + MDatabase database, String dbPrivileges, int createTime, String grantor) { + super(); + this.principalName = principalName; + this.isRole = isRole; + this.isGroup = isGroup; + this.database = database; + this.privileges = dbPrivileges; + this.createTime = createTime; + this.grantor = grantor; + } + + /** + * @return user name, role name, or group name + */ + public String getPrincipalName() { + return principalName; + } + + /** + * @param userName user/role/group name + */ + public void setPrincipalName(String userName) { + this.principalName = userName; + } + + /** + * @return true if this user name is a role + */ + public boolean getIsRole() { + return isRole; + } + + /** + * @param isRole is this user name a role? + */ + public void setIsRole(boolean isRole) { + this.isRole = isRole; + } + + /** + * @return true if this user name is a group, false else + */ + public boolean getIsGroup() { + return isGroup; + } + + /** + * @param isGroup is this user name a group + */ + public void setIsGroup(boolean isGroup) { + this.isGroup = isGroup; + } + + /** + * @return a set of privileges this user/role/group has + */ + public String getPrivileges() { + return privileges; + } + + /** + * @param dbPrivileges a set of privileges this user/role/group has + */ + public void setPrivileges(String dbPrivileges) { + this.privileges = dbPrivileges; + } + + public MDatabase getDatabase() { + return database; + } + + public void setDatabase(MDatabase database) { + this.database = database; + } + + public void setRole(boolean isRole) { + this.isRole = isRole; + } + + public void setGroup(boolean isGroup) { + this.isGroup = isGroup; + } + + public int getCreateTime() { + return createTime; + } + + public void setCreateTime(int createTime) { + this.createTime = createTime; + } + + public String getGrantor() { + return grantor; + } + + public void setGrantor(String grantor) { + this.grantor = grantor; + } + +} Index: metastore/src/model/org/apache/hadoop/hive/metastore/model/MSecurityRoleEntity.java =================================================================== --- metastore/src/model/org/apache/hadoop/hive/metastore/model/MSecurityRoleEntity.java (revision 0) +++ metastore/src/model/org/apache/hadoop/hive/metastore/model/MSecurityRoleEntity.java (revision 0) @@ -0,0 +1,75 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.hadoop.hive.metastore.model; + +public class MSecurityRoleEntity { + + private String roleName; + + private int createTime; + + private String ownerName; + + public MSecurityRoleEntity() { + } + + public MSecurityRoleEntity(String roleName, int createTime, String ownerName) { + super(); + this.roleName = roleName; + this.createTime = createTime; + this.ownerName = ownerName; + } + + /** + * @return role name + */ + public String getRoleName() { + return roleName; + } + + /** + * @param roleName + */ + public void setRoleName(String roleName) { + this.roleName = roleName; + } + + /** + * @return create time + */ + public int getCreateTime() { + return createTime; + } + + /** + * @param createTime + */ + public void setCreateTime(int createTime) { + this.createTime = createTime; + } + + public String getOwnerName() { + return ownerName; + } + + public void setOwnerName(String ownerName) { + this.ownerName = ownerName; + } + +} Index: metastore/src/model/org/apache/hadoop/hive/metastore/model/MSecurityTablePartition.java =================================================================== --- metastore/src/model/org/apache/hadoop/hive/metastore/model/MSecurityTablePartition.java (revision 0) +++ metastore/src/model/org/apache/hadoop/hive/metastore/model/MSecurityTablePartition.java (revision 0) @@ -0,0 +1,158 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.hadoop.hive.metastore.model; + +public class MSecurityTablePartition { + + private String principalName; + + private boolean isRole; + + private boolean isGroup; + + private MTable table; + + private MPartition partition; + + private String privileges; + + private int createTime; + + private String grantor; + + public MSecurityTablePartition() { + } + + public MSecurityTablePartition(String principalName, boolean isRole, + boolean isGroup, MTable table, MPartition partition, String privileges, + int createTime, String grantor) { + super(); + this.principalName = principalName; + this.isRole = isRole; + this.isGroup = isGroup; + this.table = table; + this.partition = partition; + this.privileges = privileges; + this.createTime = createTime; + this.grantor = grantor; + } + + public String getPrincipalName() { + return principalName; + } + + public void setPrincipalName(String principalName) { + this.principalName = principalName; + } + + /** + * @return true if this user name is a role + */ + public boolean getIsRole() { + return isRole; + } + + /** + * @param isRole is this user name a role? + */ + public void setIsRole(boolean isRole) { + this.isRole = isRole; + } + + /** + * @return true if this user name is a group, false else + */ + public boolean getIsGroup() { + return isGroup; + } + + /** + * @param isGroup true if is this user name a group + */ + public void setIsGroup(boolean isGroup) { + this.isGroup = isGroup; + } + + /** + * @return a set of privileges this user/role/group has + */ + public String getPrivileges() { + return privileges; + } + + /** + * @param dbPrivileges a set of privileges this user/role/group has + */ + public void setPrivileges(String dbPrivileges) { + this.privileges = dbPrivileges; + } + + /** + * @return create time + */ + public int getCreateTime() { + return createTime; + } + + /** + * @param createTime create time + */ + public void setCreateTime(int createTime) { + this.createTime = createTime; + } + + /** + * @return + */ + public String getGrantor() { + return grantor; + } + + /** + * @param grantor + */ + public void setGrantor(String grantor) { + this.grantor = grantor; + } + + public void setRole(boolean isRole) { + this.isRole = isRole; + } + + public void setGroup(boolean isGroup) { + this.isGroup = isGroup; + } + + public MTable getTable() { + return table; + } + + public void setTable(MTable table) { + this.table = table; + } + + public MPartition getPartition() { + return partition; + } + + public void setPartition(MPartition partition) { + this.partition = partition; + } + +} Index: metastore/src/model/org/apache/hadoop/hive/metastore/model/MSecurityUser.java =================================================================== --- metastore/src/model/org/apache/hadoop/hive/metastore/model/MSecurityUser.java (revision 0) +++ metastore/src/model/org/apache/hadoop/hive/metastore/model/MSecurityUser.java (revision 0) @@ -0,0 +1,127 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.hadoop.hive.metastore.model; + +/** + * User global level privileges + */ +public class MSecurityUser { + + private String principalName; + + private boolean isRole; + + private boolean isGroup; + + private String privileges; + + private int createTime; + + private String grantor; + + public MSecurityUser() { + super(); + } + + public MSecurityUser(String userName, boolean isRole, boolean isGroup, + String dbPrivileges, int createTime, String grantor) { + super(); + this.principalName = userName; + this.isRole = isRole; + this.isGroup = isGroup; + this.privileges = dbPrivileges; + this.createTime = createTime; + this.grantor = grantor; + } + + /** + * @return is this user name a role name? + */ + public boolean getIsRole() { + return isRole; + } + + /** + * @param isRole this user name is a role name? + */ + public void setIsRole(boolean isRole) { + this.isRole = isRole; + } + + /** + * @return is this user name a group name? + */ + public boolean getIsGroup() { + return isGroup; + } + + /** + * @param isGroup this user name a group name + */ + public void setIsGroup(boolean isGroup) { + this.isGroup = isGroup; + } + + /** + * @return a set of global privileges granted to this user + */ + public String getPrivileges() { + return privileges; + } + + /** + * @param dbPrivileges set of global privileges to user + */ + public void setPrivileges(String dbPrivileges) { + this.privileges = dbPrivileges; + } + + public void setRole(boolean isRole) { + this.isRole = isRole; + } + + public void setGroup(boolean isGroup) { + this.isGroup = isGroup; + } + + public String getPrincipalName() { + return principalName; + } + + public void setPrincipalName(String principalName) { + this.principalName = principalName; + } + + public int getCreateTime() { + return createTime; + } + + public void setCreateTime(int createTime) { + this.createTime = createTime; + } + + public String getGrantor() { + return grantor; + } + + public void setGrantor(String grantor) { + this.grantor = grantor; + } + +} Index: metastore/src/model/org/apache/hadoop/hive/metastore/model/MSecurityUserRoleMap.java =================================================================== --- metastore/src/model/org/apache/hadoop/hive/metastore/model/MSecurityUserRoleMap.java (revision 0) +++ metastore/src/model/org/apache/hadoop/hive/metastore/model/MSecurityUserRoleMap.java (revision 0) @@ -0,0 +1,110 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.hadoop.hive.metastore.model; + +public class MSecurityUserRoleMap { + + private String principalName; + + private boolean isRole; + + private boolean isGroup; + + private MSecurityRoleEntity role; + + private int addTime; + + public MSecurityUserRoleMap() { + } + + public MSecurityUserRoleMap(String principalName, boolean isRole, + boolean isGroup, MSecurityRoleEntity role, int addTime) { + super(); + this.principalName = principalName; + this.isRole = isRole; + this.isGroup = isGroup; + this.role = role; + this.addTime = addTime; + } + + /** + * @return principal name + */ + public String getPrincipalName() { + return principalName; + } + + /** + * @param userName principal name + */ + public void setPrincipalName(String userName) { + this.principalName = userName; + } + + /** + * @return is role + */ + public boolean isRole() { + return isRole; + } + + /** + * @param isRole + */ + public void setRole(boolean isRole) { + this.isRole = isRole; + } + + /** + * @return is group + */ + public boolean isGroup() { + return isGroup; + } + + /** + * @param isGroup + */ + public void setGroup(boolean isGroup) { + this.isGroup = isGroup; + } + + /** + * @return add time + */ + public int getAddTime() { + return addTime; + } + + /** + * @param addTime + */ + public void setAddTime(int addTime) { + this.addTime = addTime; + } + + public MSecurityRoleEntity getRole() { + return role; + } + + public void setRole(MSecurityRoleEntity role) { + this.role = role; + } + +} Index: ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java =================================================================== --- ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java (revision 1030336) +++ ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java (working copy) @@ -33,14 +33,15 @@ import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; +import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import java.util.SortedSet; import java.util.TreeSet; +import java.util.Map.Entry; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -56,12 +57,18 @@ import org.apache.hadoop.hive.metastore.TableType; import org.apache.hadoop.hive.metastore.Warehouse; import org.apache.hadoop.hive.metastore.api.AlreadyExistsException; +import org.apache.hadoop.hive.metastore.api.ColumnPrivilegeBag; import org.apache.hadoop.hive.metastore.api.Database; import org.apache.hadoop.hive.metastore.api.FieldSchema; import org.apache.hadoop.hive.metastore.api.InvalidOperationException; import org.apache.hadoop.hive.metastore.api.MetaException; import org.apache.hadoop.hive.metastore.api.NoSuchObjectException; import org.apache.hadoop.hive.metastore.api.Order; +import org.apache.hadoop.hive.metastore.api.PrivilegeBag; +import org.apache.hadoop.hive.metastore.api.SecurityColumn; +import org.apache.hadoop.hive.metastore.api.SecurityDB; +import org.apache.hadoop.hive.metastore.api.SecurityTablePartition; +import org.apache.hadoop.hive.metastore.api.SecurityUser; import org.apache.hadoop.hive.ql.Context; import org.apache.hadoop.hive.ql.DriverContext; import org.apache.hadoop.hive.ql.QueryPlan; @@ -82,7 +89,6 @@ import org.apache.hadoop.hive.ql.metadata.Table; import org.apache.hadoop.hive.ql.plan.AddPartitionDesc; import org.apache.hadoop.hive.ql.plan.AlterTableDesc; -import org.apache.hadoop.hive.ql.plan.AlterTableDesc.AlterTableTypes; import org.apache.hadoop.hive.ql.plan.AlterTableSimpleDesc; import org.apache.hadoop.hive.ql.plan.CreateDatabaseDesc; import org.apache.hadoop.hive.ql.plan.CreateIndexDesc; @@ -95,17 +101,26 @@ import org.apache.hadoop.hive.ql.plan.DropDatabaseDesc; import org.apache.hadoop.hive.ql.plan.DropIndexDesc; import org.apache.hadoop.hive.ql.plan.DropTableDesc; +import org.apache.hadoop.hive.ql.plan.GrantDesc; import org.apache.hadoop.hive.ql.plan.LockTableDesc; import org.apache.hadoop.hive.ql.plan.MsckDesc; +import org.apache.hadoop.hive.ql.plan.PrincipalDesc; +import org.apache.hadoop.hive.ql.plan.PrivilegeDesc; +import org.apache.hadoop.hive.ql.plan.PrivilegeObjectDesc; +import org.apache.hadoop.hive.ql.plan.RevokeDesc; +import org.apache.hadoop.hive.ql.plan.RoleDDLDesc; import org.apache.hadoop.hive.ql.plan.ShowDatabasesDesc; import org.apache.hadoop.hive.ql.plan.ShowFunctionsDesc; +import org.apache.hadoop.hive.ql.plan.ShowGrantDesc; import org.apache.hadoop.hive.ql.plan.ShowLocksDesc; import org.apache.hadoop.hive.ql.plan.ShowPartitionsDesc; import org.apache.hadoop.hive.ql.plan.ShowTableStatusDesc; import org.apache.hadoop.hive.ql.plan.ShowTablesDesc; import org.apache.hadoop.hive.ql.plan.SwitchDatabaseDesc; import org.apache.hadoop.hive.ql.plan.UnlockTableDesc; +import org.apache.hadoop.hive.ql.plan.AlterTableDesc.AlterTableTypes; import org.apache.hadoop.hive.ql.plan.api.StageType; +import org.apache.hadoop.hive.ql.security.authorization.Privilege; import org.apache.hadoop.hive.serde.Constants; import org.apache.hadoop.hive.serde2.Deserializer; import org.apache.hadoop.hive.serde2.MetadataTypedColumnsetSerDe; @@ -116,6 +131,7 @@ import org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe; import org.apache.hadoop.hive.shims.HadoopShims; import org.apache.hadoop.hive.shims.ShimLoader; +import org.apache.hadoop.util.StringUtils; import org.apache.hadoop.util.ToolRunner; /** * DDLTask implementation. @@ -280,6 +296,27 @@ if (showParts != null) { return showPartitions(db, showParts); } + + RoleDDLDesc roleDDLDesc = work.getRoleDDLDesc(); + if (roleDDLDesc != null) { + return roleDDL(roleDDLDesc); + } + + GrantDesc grantDesc = work.getGrantDesc(); + if (grantDesc != null) { + return grantOrRevokePrivileges(grantDesc.getPrincipals(), grantDesc.getPrivileges(), grantDesc.getPrivilegeSubjectDesc(), true); + } + + RevokeDesc revokeDesc = work.getRevokeDesc(); + if (revokeDesc != null) { + return grantOrRevokePrivileges(revokeDesc.getPrincipals(), revokeDesc + .getPrivileges(), revokeDesc.getPrivilegeSubjectDesc(), false); + } + + ShowGrantDesc showGrantDesc = work.getShowGrantDesc(); + if (showGrantDesc != null) { + return showGrants(showGrantDesc); + } } catch (InvalidTableException e) { console.printError("Table " + e.getTableName() + " does not exist"); @@ -299,6 +336,382 @@ return 0; } + private int showGrants(ShowGrantDesc showGrantDesc) throws HiveException { + try { + Path resFile = new Path(showGrantDesc.getResFile()); + FileSystem fs = resFile.getFileSystem(conf); + DataOutput outStream = fs.create(resFile); + PrincipalDesc principalDesc = showGrantDesc.getPrincipalDesc(); + boolean isGroup = (principalDesc.getType()== PrincipalDesc.PrincipalType.GROUP); + boolean isRole = (principalDesc.getType()== PrincipalDesc.PrincipalType.ROLE); + PrivilegeObjectDesc hiveObjectDesc = showGrantDesc.getHiveObj(); + String principalName = principalDesc.getName(); + if (hiveObjectDesc == null) { + //show user level privileges + List users = db.showUserLevelGrant(principalName, + isGroup, isRole); + if (users != null && users.size() > 0) { + boolean first = true; + for(SecurityUser usr: users) { + if (!first) { + outStream.write(terminator); + } else { + first = false; + } + outStream.writeBytes("userName:" + principalName); + outStream.write(terminator); + outStream.writeBytes("isRole:" + isRole); + outStream.write(terminator); + outStream.writeBytes("isGroup:" + isGroup); + outStream.write(terminator); + outStream.writeBytes("privileges:" + usr.getPrivileges()); + outStream.write(terminator); + outStream.writeBytes("grantTime:" + usr.getCreateTime()); + outStream.write(terminator); + outStream.writeBytes("grantor:" + usr.getGrantor()); + outStream.write(terminator); + } + } + } else { + String obj = hiveObjectDesc.getObject(); + boolean notFound = true; + String dbName = null; + String tableName = null; + Table tableObj = null; + Database dbObj = null; + + if (hiveObjectDesc.getTable()) { + String[] dbTab = obj.split("\\."); + if (dbTab.length == 2) { + dbName = dbTab[0]; + tableName = dbTab[1]; + } else { + dbName = db.getCurrentDatabase(); + tableName = obj; + } + dbObj = db.getDatabase(dbName); + tableObj = db.getTable(dbName, tableName); + notFound = (dbObj == null || tableObj == null); + } else { + dbName = hiveObjectDesc.getObject(); + dbObj = db.getDatabase(dbName); + notFound = (dbObj == null); + } + if (notFound) { + throw new HiveException(obj + " can not be found"); + } + + if (!hiveObjectDesc.getTable()) { + // show database level privileges + List dbs = db.showDBLevelGrant(principalName, isGroup, + isRole, dbName); + if (dbs != null && dbs.size() > 0) { + boolean first = true; + for(SecurityDB db: dbs) { + if (!first) { + outStream.write(terminator); + } else { + first = false; + } + outStream.writeBytes("dbName:" + dbName); + outStream.write(terminator); + outStream.writeBytes("userName:" + principalName); + outStream.write(terminator); + outStream.writeBytes("isRole:" + isRole); + outStream.write(terminator); + outStream.writeBytes("isGroup:" + isGroup); + outStream.write(terminator); + outStream.writeBytes("privileges:" + db.getPrivileges()); + outStream.write(terminator); + outStream.writeBytes("grantTime:" + db.getCreateTime()); + outStream.write(terminator); + outStream.writeBytes("grantor:" + db.getGrantor()); + outStream.write(terminator); + } + } + + } else { + if (hiveObjectDesc.getPartSpec() != null) { + // show partition level privileges + List parts = db.showPartitionGrant(principalName, + isGroup, isRole, dbName, tableName, Warehouse.makePartName(hiveObjectDesc.getPartSpec(), false)); + if (parts != null && parts.size() > 0) { + boolean first = true; + for(SecurityTablePartition part: parts) { + if (!first) { + outStream.write(terminator); + } else { + first = false; + } + outStream.writeBytes("dbName:" + dbName); + outStream.write(terminator); + outStream.writeBytes("tableName:" + tableName); + outStream.write(terminator); + outStream.writeBytes("partName:" + + Warehouse.makePartName(part.getTable().getPartitionKeys(), part + .getPart().getValues())); + outStream.write(terminator); + outStream.writeBytes("userName:" + principalName); + outStream.write(terminator); + outStream.writeBytes("isRole:" + isRole); + outStream.write(terminator); + outStream.writeBytes("isGroup:" + isGroup); + outStream.write(terminator); + outStream.writeBytes("privileges:" + part.getPrivileges()); + outStream.write(terminator); + outStream.writeBytes("grantTime:" + part.getCreateTime()); + outStream.write(terminator); + outStream.writeBytes("grantor:" + part.getGrantor()); + outStream.write(terminator); + } + } + } else if (showGrantDesc.getColumns() != null) { + // show column level privileges + for (String columnName : showGrantDesc.getColumns()) { + List columnss = db.showColumnGrant(principalName, + isGroup, isRole, dbName, tableName, columnName); + if (columnss != null && columnss.size() > 0) { + boolean first = true; + for (SecurityColumn col : columnss) { + if (!first) { + outStream.write(terminator); + } else { + first = false; + } + outStream.writeBytes("dbName:" + dbName); + outStream.write(terminator); + outStream.writeBytes("tableName:" + tableName); + outStream.write(terminator); + outStream.writeBytes("columnName:" + columnName); + outStream.write(terminator); + outStream.writeBytes("userName:" + principalName); + outStream.write(terminator); + outStream.writeBytes("isRole:" + isRole); + outStream.write(terminator); + outStream.writeBytes("isGroup:" + isGroup); + outStream.write(terminator); + outStream.writeBytes("privileges:" + col.getPrivileges()); + outStream.write(terminator); + outStream.writeBytes("grantTime:" + col.getCreateTime()); + outStream.write(terminator); + outStream.writeBytes("grantor:" + col.getGrantor()); + outStream.write(terminator); + } + } + } + } else { + // show table level privileges + List tbls = db.showTableLevelGrant( + principalName, isGroup, isRole, dbName, tableName); + if (tbls!= null && tbls.size() > 0) { + boolean first = true; + for(SecurityTablePartition tbl: tbls) { + if (!first) { + outStream.write(terminator); + } else { + first = false; + } + outStream.writeBytes("dbName:" + dbName); + outStream.write(terminator); + outStream.writeBytes("tableName:" + tableName); + outStream.write(terminator); + outStream.writeBytes("userName:" + principalName); + outStream.write(terminator); + outStream.writeBytes("isRole:" + isRole); + outStream.write(terminator); + outStream.writeBytes("isGroup:" + isGroup); + outStream.write(terminator); + outStream.writeBytes("privileges:" + tbl.getPrivileges()); + outStream.write(terminator); + outStream.writeBytes("grantTime:" + tbl.getCreateTime()); + outStream.write(terminator); + outStream.writeBytes("grantor:" + tbl.getGrantor()); + outStream.write(terminator); + } + } + } + } + } + ((FSDataOutputStream) outStream).close(); + } catch (FileNotFoundException e) { + LOG.info("show table status: " + stringifyException(e)); + return 1; + } catch (IOException e) { + LOG.info("show table status: " + stringifyException(e)); + return 1; + } catch (Exception e) { + e.printStackTrace(); + throw new HiveException(e); + } + return 0; + } + + private int grantOrRevokePrivileges(List principals, + List privileges, PrivilegeObjectDesc privSubjectDesc, + boolean grant) { + if (privileges == null || privileges.size() == 0) { + console.printError("No privilege found."); + return 1; + } + + String dbName = null; + String tableName = null; + Table tableObj = null; + Database dbObj = null; + + try { + + if (privSubjectDesc != null) { + if (privSubjectDesc.getPartSpec() != null && grant) { + throw new HiveException("Grant does not support partition level."); + } + String obj = privSubjectDesc.getObject(); + boolean notFound = true; + if (privSubjectDesc.getTable()) { + String[] dbTab = obj.split("\\."); + if (dbTab.length == 2) { + dbName = dbTab[0]; + tableName = dbTab[1]; + } else { + dbName = db.getCurrentDatabase(); + tableName = obj; + } + dbObj = db.getDatabase(dbName); + tableObj = db.getTable(dbName, tableName); + notFound = (dbObj == null || tableObj == null); + } else { + dbName = privSubjectDesc.getObject(); + dbObj = db.getDatabase(dbName); + notFound = (dbObj == null); + } + if (notFound) { + throw new HiveException(obj + " can not be found"); + } + } + + PrivilegeBag privBag = new PrivilegeBag(); + String userPrivs = ""; + if (privSubjectDesc == null) { + boolean first = true; + for (int idx = 0; idx < privileges.size(); idx++) { + Privilege priv = privileges.get(idx).getPrivilege(); + if (privileges.get(idx).getColumns() != null + && privileges.get(idx).getColumns().size() > 0) { + throw new HiveException( + "For user-level privielges, column sets should be null. columns=" + + privileges.get(idx).getColumns().toString()); + } + if (!first) { + userPrivs = userPrivs + StringUtils.COMMA; + } else { + first = false; + } + userPrivs = userPrivs + priv.getPriv(); + } + privBag.setUserPrivileges(userPrivs); + } else { + List columnPrivBags = new ArrayList(); + Map dbPrivs = new HashMap(); + Map tabPrivs = new HashMap(); + Map partPrivs = new HashMap(); + org.apache.hadoop.hive.metastore.api.Partition partObj = null; + if (privSubjectDesc.getPartSpec() != null) { + partObj = db.getPartition(tableObj, privSubjectDesc.getPartSpec(), false).getTPartition(); + } + + for (PrivilegeDesc privDesc : privileges) { + List columns = privDesc.getColumns(); + Privilege priv = privDesc.getPrivilege(); + if (columns != null && columns.size() > 0) { + if (!priv.getSupportColumnLevel()) { + throw new HiveException(priv.getPriv() + + " does not support column level."); + } + if (privSubjectDesc == null || tableName == null + || (privSubjectDesc.getPartSpec() != null)) { + throw new HiveException( + "For user-level/database-level/partition privielges, column sets should be null. columns=" + + columns); + } + Map columnPrivileges = new HashMap(); + for (int i = 0; i < columns.size(); i++) { + columnPrivileges.put(columns.get(i), priv.getPriv()); + } + ColumnPrivilegeBag columnPrivBag = new ColumnPrivilegeBag(dbName, + tableName, columnPrivileges); + columnPrivBags.add(columnPrivBag); + } else { + if (privSubjectDesc.getTable()) { + if (privSubjectDesc.getPartSpec() != null && !grant) { + partPrivs.put(partObj, priv.getPriv()); + } else { + tabPrivs.put(tableObj.getTTable(), priv.getPriv()); + } + } else { + dbPrivs.put(dbObj, priv.getPriv()); + } + } + } + + if (columnPrivBags.size() > 0) { + privBag.setColumnPrivileges(columnPrivBags); + } + if (tabPrivs.size() > 0) { + privBag.setTablePrivileges(tabPrivs); + } + + if (partPrivs != null && partPrivs.size() > 0) { + privBag.setPartitionPrivileges(partPrivs); + } + if (dbPrivs.size() > 0) { + privBag.setDbPrivileges(dbPrivs); + } + } + + for (PrincipalDesc principal : principals) { + boolean isRole = (principal.getType() == PrincipalDesc.PrincipalType.ROLE); + boolean isGroup = (principal.getType() == PrincipalDesc.PrincipalType.GROUP); + if (grant) { + db + .grantPrivileges(principal.getName(), isRole, isGroup, privBag, + ""); + } else { + db + .revokePrivileges(principal.getName(), isRole, isGroup, privBag, + ""); + } + } + } catch (HiveException e) { + e.printStackTrace(); + console.printError("Error: " + e.getMessage()); + return 1; + } + + return 0; + } + + private int roleDDL(RoleDDLDesc roleDDLDesc) { + RoleDDLDesc.RoleOperation operation = roleDDLDesc.getOperation(); + try { + if (operation.equals(RoleDDLDesc.RoleOperation.CREATE_ROLE)) { + db.createRole(roleDDLDesc.getRoleName()); + } else if (operation.equals(RoleDDLDesc.RoleOperation.DROP_ROLE)) { + db.dropRole(roleDDLDesc.getRoleName()); + } else { + throw new HiveException("Unkown role operation " + + operation.getOperationName()); + } + } catch (HiveException e) { + e.printStackTrace(); + console.printError("Error in role operation " + + operation.getOperationName() + " on role name " + + roleDDLDesc.getRoleName() + ", error message " + e.getMessage()); + return 1; + } + + return 0; + } + private int dropIndex(Hive db, DropIndexDesc dropIdx) throws HiveException { db.dropIndex(db.getCurrentDatabase(), dropIdx.getTableName(), dropIdx.getIndexName(), true); Index: ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java =================================================================== --- ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java (revision 1030336) +++ ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java (working copy) @@ -57,11 +57,18 @@ import org.apache.hadoop.hive.metastore.api.Database; import org.apache.hadoop.hive.metastore.api.FieldSchema; import org.apache.hadoop.hive.metastore.api.Index; +import org.apache.hadoop.hive.metastore.api.InvalidObjectException; import org.apache.hadoop.hive.metastore.api.InvalidOperationException; import org.apache.hadoop.hive.metastore.api.MetaException; import org.apache.hadoop.hive.metastore.api.NoSuchObjectException; import org.apache.hadoop.hive.metastore.api.Order; +import org.apache.hadoop.hive.metastore.api.PrivilegeBag; +import org.apache.hadoop.hive.metastore.api.SecurityColumn; +import org.apache.hadoop.hive.metastore.api.SecurityDB; +import org.apache.hadoop.hive.metastore.api.SecurityTablePartition; +import org.apache.hadoop.hive.metastore.api.SecurityUser; import org.apache.hadoop.hive.metastore.api.SerDeInfo; +import org.apache.hadoop.hive.metastore.model.MSecurityUser; import org.apache.hadoop.hive.ql.exec.Utilities; import org.apache.hadoop.hive.ql.index.HiveIndexHandler; import org.apache.hadoop.hive.serde2.Deserializer; @@ -724,7 +731,7 @@ } catch (NoSuchObjectException e) { if (throwException) { LOG.error(StringUtils.stringifyException(e)); - throw new InvalidTableException("Table not found ", tableName); + throw new InvalidTableException("Table " + tableName + " not found ", tableName); } return null; } catch (Exception e) { @@ -864,6 +871,52 @@ } } + public boolean grantPrivileges(String userName, boolean isRole, + boolean isGroup, PrivilegeBag privileges, String grantor) + throws HiveException { + try { + return getMSC().grant_privileges(userName, isRole, isGroup, privileges, + grantor); + } catch (Exception e) { + throw new HiveException(e); + } + } + + /** + * @param userName + * principal name + * @param isRole + * is the given principal name a role + * @param isGroup + * is the given principal name a group + * @param privileges + * a bag of privileges + * @return + * @throws HiveException + */ + public boolean revokePrivileges(String userName, boolean isRole, + boolean isGroup, PrivilegeBag privileges, String grantor) + throws HiveException { + try { + return getMSC().revoke_privileges(userName, isRole, isGroup, privileges); + } catch (Exception e) { + throw new HiveException(e); + } + } + + /** + * @param dbName + * @return + * @throws HiveException + */ + public Database getDatabase(String dbName) throws HiveException { + try { + return getMSC().getDatabase(dbName); + } catch (Exception e) { + throw new HiveException(e); + } + } + /** * Query metadata to see if a database with the given name already exists. * @@ -1349,6 +1402,74 @@ public void setCurrentDatabase(String currentDatabase) { this.currentDatabase = currentDatabase; } + + public void createRole(String roleName) throws HiveException { + try { + getMSC().create_role(roleName, ""); + } catch (Exception e) { + throw new HiveException(e); + } + } + + public void dropRole(String roleName) throws HiveException { + try { + getMSC().drop_role(roleName); + } catch (Exception e) { + throw new HiveException(e); + } + } + + public List showUserLevelGrant(String principalName, + boolean isRole, boolean isGroup) throws HiveException { + try { + return getMSC().list_security_user_grant(principalName, isRole, isGroup); + } catch (Exception e) { + throw new HiveException(e); + } + } + + public List showDBLevelGrant(String principalName, + boolean isGroup, boolean isRole, String dbName) throws HiveException { + try { + return getMSC().list_security_db_grant(principalName, isGroup, isRole, + dbName); + } catch (Exception e) { + throw new HiveException(e); + } + } + + public List showTableLevelGrant( + String principalName, boolean isGroup, boolean isRole, String dbName, + String tableName) throws HiveException { + try { + return getMSC().list_security_table_grant(principalName, isGroup, + isRole, dbName, tableName); + } catch (Exception e) { + throw new HiveException(e); + } + } + + public List showPartitionGrant( + String principalName, boolean isGroup, boolean isRole, String dbName, + String tableName, String partName) throws HiveException { + try { + return getMSC().list_security_partition_grant(principalName, isGroup, + isRole, dbName, tableName, partName); + } catch (Exception e) { + throw new HiveException(e); + } + } + + public List showColumnGrant(String principal_name, + boolean isGroup, boolean isRole, String dbName, String tableName, + String columnName) throws HiveException { + try { + return getMSC().list_security_column_grant(principal_name, isGroup, + isRole, dbName, tableName, columnName); + } catch (Exception e) { + throw new HiveException(e); + } + } static private void checkPaths(FileSystem fs, FileStatus[] srcs, Path destf, boolean replace) throws HiveException { Index: ql/src/java/org/apache/hadoop/hive/ql/parse/DDLSemanticAnalyzer.java =================================================================== --- ql/src/java/org/apache/hadoop/hive/ql/parse/DDLSemanticAnalyzer.java (revision 1030336) +++ ql/src/java/org/apache/hadoop/hive/ql/parse/DDLSemanticAnalyzer.java (working copy) @@ -68,6 +68,12 @@ import org.apache.hadoop.hive.ql.plan.AlterTableSimpleDesc; import org.apache.hadoop.hive.ql.plan.CreateDatabaseDesc; import org.apache.hadoop.hive.ql.plan.CreateIndexDesc; +import org.apache.hadoop.hive.ql.plan.GrantDesc; +import org.apache.hadoop.hive.ql.plan.PrincipalDesc; +import org.apache.hadoop.hive.ql.plan.PrivilegeDesc; +import org.apache.hadoop.hive.ql.plan.PrivilegeObjectDesc; +import org.apache.hadoop.hive.ql.plan.RevokeDesc; +import org.apache.hadoop.hive.ql.plan.RoleDDLDesc; import org.apache.hadoop.hive.ql.plan.DDLWork; import org.apache.hadoop.hive.ql.plan.DescFunctionDesc; import org.apache.hadoop.hive.ql.plan.DescTableDesc; @@ -79,6 +85,7 @@ import org.apache.hadoop.hive.ql.plan.MsckDesc; import org.apache.hadoop.hive.ql.plan.ShowDatabasesDesc; import org.apache.hadoop.hive.ql.plan.ShowFunctionsDesc; +import org.apache.hadoop.hive.ql.plan.ShowGrantDesc; import org.apache.hadoop.hive.ql.plan.ShowLocksDesc; import org.apache.hadoop.hive.ql.plan.ShowPartitionsDesc; import org.apache.hadoop.hive.ql.plan.ShowTableStatusDesc; @@ -87,9 +94,12 @@ import org.apache.hadoop.hive.ql.plan.TableDesc; import org.apache.hadoop.hive.ql.plan.UnlockTableDesc; import org.apache.hadoop.hive.ql.plan.AlterTableDesc.AlterTableTypes; +import org.apache.hadoop.hive.ql.security.authorization.Privilege; +import org.apache.hadoop.hive.ql.security.authorization.PrivilegeRegistry; import org.apache.hadoop.hive.serde.Constants; import org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe; import org.apache.hadoop.mapred.TextInputFormat; +import org.apache.hadoop.util.StringUtils; /** * DDLSemanticAnalyzer. @@ -242,11 +252,181 @@ analyzeDropDatabase(ast); } else if (ast.getToken().getType() == TOK_SWITCHDATABASE) { analyzeSwitchDatabase(ast); + } else if (ast.getToken().getType() == HiveParser.TOK_CREATEROLE) { + analyzeCreateRole(ast); + } else if (ast.getToken().getType() == HiveParser.TOK_DROPROLE) { + analyzeDropRole(ast); + } else if (ast.getToken().getType() == HiveParser.TOK_GRANT) { + analyzeGrant(ast); + } else if (ast.getToken().getType() == HiveParser.TOK_SHOW_GRANT) { + ctx.setResFile(new Path(ctx.getLocalTmpFileURI())); + analyzeShowGrant(ast); + } else if (ast.getToken().getType() == HiveParser.TOK_REVOKE) { + analyzeRevoke(ast); } else { throw new SemanticException("Unsupported command."); } } + private void analyzeShowGrant(ASTNode ast) throws SemanticException { + PrivilegeObjectDesc privHiveObj = null; + + ASTNode principal = (ASTNode) ast.getChild(0); + PrincipalDesc.PrincipalType type = null; + switch (principal.getType()) { + case HiveParser.TOK_USER: + type = PrincipalDesc.PrincipalType.USER; + break; + case HiveParser.TOK_GROUP: + type = PrincipalDesc.PrincipalType.GROUP; + break; + case HiveParser.TOK_ROLE: + type = PrincipalDesc.PrincipalType.ROLE; + break; + } + String principlaName = unescapeIdentifier(principal.getChild(0).getText()); + PrincipalDesc principalDesc = new PrincipalDesc(principlaName, type); + List cols = null; + if (ast.getChildCount() > 1) { + for (int i = 1; i < ast.getChildCount(); i++) { + ASTNode child = (ASTNode) ast.getChild(i); + if (child.getToken().getType() == HiveParser.TOK_PRIV_OBJECT) { + privHiveObj = analyzePrivilegeObject(child); + } else if (child.getToken().getType() == HiveParser.TOK_TABCOLNAME) { + cols = getColumnNames((ASTNode) child); + } + } + } + + if (privHiveObj == null && cols != null) { + throw new SemanticException( + "For user-level privielges, column sets should be null. columns=" + + cols.toString()); + } + + ShowGrantDesc showGrant = new ShowGrantDesc(ctx.getResFile().toString(), + principalDesc, privHiveObj, cols); + rootTasks.add(TaskFactory.get(new DDLWork(getInputs(), getOutputs(), + showGrant), conf)); + } + + private void analyzeGrant(ASTNode ast) throws SemanticException { + List privilegeDesc = analyzePrivilegeListDef( + (ASTNode) ast.getChild(0)); + List principalDesc = analyzePrinciplaListDef( + (ASTNode) ast.getChild(1)); + boolean grantOption = false; + PrivilegeObjectDesc subjectObj = null; + + if (ast.getChildCount() > 2) { + for (int i = 2; i < ast.getChildCount(); i++) { + ASTNode astChild = (ASTNode) ast.getChild(i); + if (astChild.getType() == HiveParser.TOK_GRANT_WITH_OPTION) { + grantOption = true; + } else if (astChild.getType() == HiveParser.TOK_PRIV_OBJECT) { + subjectObj = analyzePrivilegeObject(astChild); + } + } + } + + GrantDesc grantDesc = new GrantDesc(subjectObj, privilegeDesc, principalDesc, grantOption); + rootTasks.add(TaskFactory.get(new DDLWork(getInputs(), getOutputs(), + grantDesc), conf)); + } + + private void analyzeRevoke(ASTNode ast) throws SemanticException { + List privilegeDesc = analyzePrivilegeListDef( + (ASTNode) ast.getChild(0)); + List principalDesc = analyzePrinciplaListDef( + (ASTNode) ast.getChild(1)); + PrivilegeObjectDesc hiveObj = null; + if (ast.getChildCount() > 2) { + ASTNode astChild = (ASTNode) ast.getChild(2); + hiveObj = analyzePrivilegeObject(astChild); + } + + RevokeDesc revokeDesc = new RevokeDesc(privilegeDesc, principalDesc, hiveObj); + rootTasks.add(TaskFactory.get(new DDLWork(getInputs(), getOutputs(), + revokeDesc), conf)); + } + + + private PrivilegeObjectDesc analyzePrivilegeObject(ASTNode ast) + throws SemanticException { + PrivilegeObjectDesc subject = new PrivilegeObjectDesc(); + subject.setTable(ast.getChild(0) != null); + subject.setObject(unescapeIdentifier(ast.getChild(1).getText())); + if (ast.getChildCount() > 2) { + ASTNode astChild = (ASTNode) ast.getChild(2); + if (astChild.getToken().getType() == HiveParser.TOK_PARTSPEC) { + subject.setPartSpec(DDLSemanticAnalyzer.getPartSpec(astChild)); + } + } + return subject; + } + + private List analyzePrinciplaListDef(ASTNode node) { + List principalList = new ArrayList(); + + for (int i = 0; i < node.getChildCount(); i++) { + ASTNode child = (ASTNode) node.getChild(i); + PrincipalDesc.PrincipalType type = null; + switch (child.getType()) { + case HiveParser.TOK_USER: + type = PrincipalDesc.PrincipalType.USER; + break; + case HiveParser.TOK_GROUP: + type = PrincipalDesc.PrincipalType.GROUP; + break; + case HiveParser.TOK_ROLE: + type = PrincipalDesc.PrincipalType.ROLE; + break; + } + String principlaName = unescapeIdentifier(child.getChild(0).getText()); + PrincipalDesc principalDesc = new PrincipalDesc(principlaName, type); + principalList.add(principalDesc); + } + + return principalList; + } + + private List analyzePrivilegeListDef(ASTNode node) + throws SemanticException { + List ret = new ArrayList(); + for (int i = 0; i < node.getChildCount(); i++) { + ASTNode privilegeDef = (ASTNode) node.getChild(i); + String privilegeStr = unescapeIdentifier(privilegeDef.getChild(0) + .getText()); + Privilege privObj = PrivilegeRegistry.getPrivilege(privilegeStr); + if (privObj == null) { + throw new SemanticException("undefined privilege " + privilegeStr); + } + List cols = null; + if (privilegeDef.getChildCount() > 1) { + cols = getColumnNames((ASTNode) privilegeDef.getChild(1)); + } + PrivilegeDesc privilegeDesc = new PrivilegeDesc(privObj, cols); + ret.add(privilegeDesc); + } + return ret; + } + + private void analyzeCreateRole(ASTNode ast) { + String roleName = unescapeIdentifier(ast.getChild(0).getText()); + RoleDDLDesc createRoleDesc = new RoleDDLDesc(roleName, + RoleDDLDesc.RoleOperation.CREATE_ROLE); + rootTasks.add(TaskFactory.get(new DDLWork(getInputs(), getOutputs(), + createRoleDesc), conf)); + } + + private void analyzeDropRole(ASTNode ast) { + String roleName = unescapeIdentifier(ast.getChild(0).getText()); + RoleDDLDesc createRoleDesc = new RoleDDLDesc(roleName, + RoleDDLDesc.RoleOperation.DROP_ROLE); + rootTasks.add(TaskFactory.get(new DDLWork(getInputs(), getOutputs(), + createRoleDesc), conf)); + } + private void analyzeCreateDatabase(ASTNode ast) throws SemanticException { String dbName = unescapeIdentifier(ast.getChild(0).getText()); boolean ifNotExists = false; Index: ql/src/java/org/apache/hadoop/hive/ql/parse/Hive.g =================================================================== --- ql/src/java/org/apache/hadoop/hive/ql/parse/Hive.g (revision 1030336) +++ ql/src/java/org/apache/hadoop/hive/ql/parse/Hive.g (working copy) @@ -188,6 +188,19 @@ TOK_LATERAL_VIEW; TOK_TABALIAS; TOK_ANALYZE; +TOK_CREATEROLE; +TOK_DROPROLE; +TOK_GRANT; +TOK_REVOKE; +TOK_SHOW_GRANT; +TOK_PRIVILEGE_LIST; +TOK_PRIVILEGE; +TOK_PRINCIPAL_NAME; +TOK_USER; +TOK_GROUP; +TOK_ROLE; +TOK_GRANT_WITH_OPTION; +TOK_PRIV_OBJECT; } @@ -258,6 +271,11 @@ | analyzeStatement | lockStatement | unlockStatement + | createRoleStatement + | dropRoleStatement + | grantPrivileges + | revokePrivileges + | showGrants ; ifExists @@ -681,6 +699,86 @@ : KW_UNLOCK KW_TABLE Identifier partitionSpec? -> ^(TOK_UNLOCKTABLE Identifier partitionSpec?) ; +createRoleStatement +@init { msgs.push("create role"); } +@after { msgs.pop(); } + : KW_CREATE KW_ROLE roleName=Identifier + -> ^(TOK_CREATEROLE $roleName) + ; + +dropRoleStatement +@init {msgs.push("drop role");} +@after {msgs.pop();} + : KW_DROP KW_ROLE roleName=Identifier + -> ^(TOK_DROPROLE $roleName) + ; + +grantPrivileges +@init {msgs.push("grant privileges");} +@after {msgs.pop();} + : KW_GRANT privList=privilegeList + privilegeObject? + KW_TO principalSpecification + (KW_WITH withOption)? + -> ^(TOK_GRANT $privList principalSpecification privilegeObject? withOption?) + ; + +revokePrivileges +@init {msgs.push("revoke privileges");} +@afer {msgs.pop();} + : KW_REVOKE privilegeList privilegeObject? KW_FROM principalSpecification + -> ^(TOK_REVOKE privilegeList principalSpecification privilegeObject?) + ; + +showGrants +@init {msgs.push("show grants");} +@after {msgs.pop();} + : KW_SHOW KW_GRANT principalName privilegeObject? (LPAREN cols=columnNameList RPAREN)? + -> ^(TOK_SHOW_GRANT principalName privilegeObject? $cols?) + ; + +privilegeObject +@init {msgs.push("privilege subject");} +@after {msgs.pop();} + : KW_ON (table=KW_TABLE|KW_DATABASE) Identifier partitionSpec? + -> ^(TOK_PRIV_OBJECT $table Identifier partitionSpec?) + ; + +privilegeList +@init {msgs.push("grant privilege list");} +@after {msgs.pop();} + : privlegeDef (COMMA privlegeDef)* + -> ^(TOK_PRIVILEGE_LIST privlegeDef+) + ; + +privlegeDef +@init {msgs.push("grant privilege");} +@after {msgs.pop();} + : Identifier (LPAREN cols=columnNameList RPAREN)? + -> ^(TOK_PRIVILEGE Identifier $cols?) + ; + +principalSpecification +@init { msgs.push("user/group/role name list"); } +@after { msgs.pop(); } + : principalName (COMMA principalName)* -> ^(TOK_PRINCIPAL_NAME principalName+) + ; + +principalName +@init {msgs.push("user|group|role name");} +@after {msgs.pop();} + : KW_USER Identifier -> ^(TOK_USER Identifier) + | KW_GROUP Identifier -> ^(TOK_GROUP Identifier) + | KW_ROLE Identifier -> ^(TOK_ROLE Identifier) + ; + +withOption +@init {msgs.push("grant with option");} +@after {msgs.pop();} + : KW_GRANT KW_OPTION + -> ^(TOK_GRANT_WITH_OPTION) + ; + metastoreCheck @init { msgs.push("metastore check statement"); } @after { msgs.pop(); } @@ -1923,6 +2021,10 @@ KW_COMPUTE: 'COMPUTE'; KW_STATISTICS: 'STATISTICS'; KW_USE: 'USE'; +KW_USER: 'USER'; +KW_ROLE: 'ROLE'; +KW_OPTION: 'OPTION'; + // Operators // NOTE: if you add a new function/operator, add it to sysFuncNames so that describe function _FUNC_ will work. Index: ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java =================================================================== --- ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java (revision 1030336) +++ ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java (working copy) @@ -18,8 +18,6 @@ package org.apache.hadoop.hive.ql.parse; -import static org.apache.hadoop.util.StringUtils.stringifyException; - import java.io.IOException; import java.io.Serializable; import java.util.ArrayList; @@ -885,7 +883,7 @@ } catch (HiveException e) { // Has to use full name to make sure it does not conflict with // org.apache.commons.lang.StringUtils - LOG.error(stringifyException(e)); + LOG.error(org.apache.hadoop.util.StringUtils.stringifyException(e)); throw new SemanticException(e.getMessage(), e); } } @@ -921,7 +919,7 @@ // an old SQL construct which has been eliminated in a later Hive // version, so we need to provide full debugging info to help // with fixing the view definition. - LOG.error(stringifyException(e)); + LOG.error(org.apache.hadoop.util.StringUtils.stringifyException(e)); StringBuilder sb = new StringBuilder(); sb.append(e.getMessage()); ErrorMsg.renderOrigin(sb, viewOrigin); @@ -6106,7 +6104,7 @@ } catch (HiveException e) { // Has to use full name to make sure it does not conflict with // org.apache.commons.lang.StringUtils - LOG.error(stringifyException(e)); + LOG.error(org.apache.hadoop.util.StringUtils.stringifyException(e)); throw new SemanticException(e.getMessage(), e); } Index: ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzerFactory.java =================================================================== --- ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzerFactory.java (revision 1030336) +++ ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzerFactory.java (working copy) @@ -72,6 +72,11 @@ commandType.put(HiveParser.TOK_QUERY, "QUERY"); commandType.put(HiveParser.TOK_LOCKTABLE, "LOCKTABLE"); commandType.put(HiveParser.TOK_UNLOCKTABLE, "UNLOCKTABLE"); + commandType.put(HiveParser.TOK_CREATEROLE, "CREATEROLE"); + commandType.put(HiveParser.TOK_DROPROLE, "DROPROLE"); + commandType.put(HiveParser.TOK_GRANT, "GRANT_PRIVILEGE"); + commandType.put(HiveParser.TOK_REVOKE, "REVOKE_PRIVILEGE"); + commandType.put(HiveParser.TOK_SHOW_GRANT, "SHOW_GRANT"); } static { @@ -129,6 +134,11 @@ case HiveParser.TOK_ALTERTABLE_UNARCHIVE: case HiveParser.TOK_LOCKTABLE: case HiveParser.TOK_UNLOCKTABLE: + case HiveParser.TOK_CREATEROLE: + case HiveParser.TOK_DROPROLE: + case HiveParser.TOK_GRANT: + case HiveParser.TOK_REVOKE: + case HiveParser.TOK_SHOW_GRANT: return new DDLSemanticAnalyzer(conf); case HiveParser.TOK_ALTERTABLE_PARTITION: String commandType = null; Index: ql/src/java/org/apache/hadoop/hive/ql/plan/DDLWork.java =================================================================== --- ql/src/java/org/apache/hadoop/hive/ql/plan/DDLWork.java (revision 1030336) +++ ql/src/java/org/apache/hadoop/hive/ql/plan/DDLWork.java (working copy) @@ -53,7 +53,12 @@ private AlterTableSimpleDesc alterTblSimpleDesc; private MsckDesc msckDesc; private ShowTableStatusDesc showTblStatusDesc; - + + private RoleDDLDesc roleDDLDesc; + private GrantDesc grantDesc; + private ShowGrantDesc showGrantDesc; + private RevokeDesc revokeDesc; + /** * ReadEntitites that are passed to the hooks. */ @@ -295,6 +300,30 @@ this.dropIdxDesc = dropIndexDesc; } + public DDLWork(HashSet inputs, HashSet outputs, + RoleDDLDesc roleDDLDesc) { + this(inputs, outputs); + this.roleDDLDesc = roleDDLDesc; + } + + public DDLWork(HashSet inputs, HashSet outputs, + GrantDesc grantDesc) { + this(inputs, outputs); + this.grantDesc = grantDesc; + } + + public DDLWork(HashSet inputs, HashSet outputs, + ShowGrantDesc showGrant) { + this(inputs, outputs); + this.showGrantDesc = showGrant; + } + + public DDLWork(HashSet inputs, HashSet outputs, + RevokeDesc revokeDesc) { + this(inputs, outputs); + this.revokeDesc = revokeDesc; + } + /** * @return Create Database descriptor */ @@ -668,4 +697,54 @@ this.dropIdxDesc = dropIdxDesc; } + /** + * @return role ddl desc + */ + public RoleDDLDesc getRoleDDLDesc() { + return roleDDLDesc; + } + + /** + * @param roleDDLDesc role ddl desc + */ + public void setRoleDDLDesc(RoleDDLDesc roleDDLDesc) { + this.roleDDLDesc = roleDDLDesc; + } + + /** + * @return grant desc + */ + public GrantDesc getGrantDesc() { + return grantDesc; + } + + /** + * @param grantDesc grant desc + */ + public void setGrantDesc(GrantDesc grantDesc) { + this.grantDesc = grantDesc; + } + + /** + * @return show grant desc + */ + public ShowGrantDesc getShowGrantDesc() { + return showGrantDesc; + } + + /** + * @param showGrantDesc + */ + public void setShowGrantDesc(ShowGrantDesc showGrantDesc) { + this.showGrantDesc = showGrantDesc; + } + + public RevokeDesc getRevokeDesc() { + return revokeDesc; + } + + public void setRevokeDesc(RevokeDesc revokeDesc) { + this.revokeDesc = revokeDesc; + } + } Index: ql/src/java/org/apache/hadoop/hive/ql/plan/GrantDesc.java =================================================================== --- ql/src/java/org/apache/hadoop/hive/ql/plan/GrantDesc.java (revision 0) +++ ql/src/java/org/apache/hadoop/hive/ql/plan/GrantDesc.java (revision 0) @@ -0,0 +1,107 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.hadoop.hive.ql.plan; + +import java.io.Serializable; +import java.util.List; + +@Explain(displayName = "Grant") +public class GrantDesc extends DDLDesc implements Serializable, Cloneable { + + private static final long serialVersionUID = 1L; + + private List privileges; + + private List principals; + + private boolean grantOption; + + private PrivilegeObjectDesc privilegeSubjectDesc; + + public GrantDesc(PrivilegeObjectDesc privilegeSubject, + List privilegeDesc, List principalDesc, + boolean grantOption) { + super(); + this.privilegeSubjectDesc = privilegeSubject; + this.privileges = privilegeDesc; + this.principals = principalDesc; + this.grantOption = grantOption; + } + + /** + * @return privileges + */ + @Explain(displayName = "Privileges") + public List getPrivileges() { + return privileges; + } + + /** + * @param privileges + */ + public void setPrivileges(List privileges) { + this.privileges = privileges; + } + + /** + * @return principals + */ + @Explain(displayName = "Principals") + public List getPrincipals() { + return principals; + } + + /** + * @param principals + */ + public void setPrincipals(List principals) { + this.principals = principals; + } + + /** + * @return grant option + */ + @Explain(displayName = "grant option") + public boolean isGrantOption() { + return grantOption; + } + + /** + * @param grantOption + */ + public void setGrantOption(boolean grantOption) { + this.grantOption = grantOption; + } + + /** + * @return privilege subject + */ + @Explain(displayName="privilege subject") + public PrivilegeObjectDesc getPrivilegeSubjectDesc() { + return privilegeSubjectDesc; + } + + /** + * @param privilegeSubjectDesc + */ + public void setPrivilegeSubjectDesc(PrivilegeObjectDesc privilegeSubjectDesc) { + this.privilegeSubjectDesc = privilegeSubjectDesc; + } + +} Index: ql/src/java/org/apache/hadoop/hive/ql/plan/PrincipalDesc.java =================================================================== --- ql/src/java/org/apache/hadoop/hive/ql/plan/PrincipalDesc.java (revision 0) +++ ql/src/java/org/apache/hadoop/hive/ql/plan/PrincipalDesc.java (revision 0) @@ -0,0 +1,64 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.hadoop.hive.ql.plan; + +import java.io.Serializable; + +@Explain(displayName = "Principal") +public class PrincipalDesc implements Serializable, Cloneable { + + private static final long serialVersionUID = 1L; + + public static enum PrincipalType { + USER, GROUP, ROLE; + } + + private String name; + + private PrincipalType type; + + public PrincipalDesc(String name, PrincipalType type) { + super(); + this.name = name; + this.type = type; + } + + public PrincipalDesc() { + super(); + } + + @Explain(displayName="name") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + @Explain(displayName="type") + public PrincipalType getType() { + return type; + } + + public void setType(PrincipalType type) { + this.type = type; + } + +} Index: ql/src/java/org/apache/hadoop/hive/ql/plan/PrivilegeDesc.java =================================================================== --- ql/src/java/org/apache/hadoop/hive/ql/plan/PrivilegeDesc.java (revision 0) +++ ql/src/java/org/apache/hadoop/hive/ql/plan/PrivilegeDesc.java (revision 0) @@ -0,0 +1,74 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.hadoop.hive.ql.plan; + +import java.io.Serializable; +import java.util.List; + +import org.apache.hadoop.hive.ql.security.authorization.Privilege; + +@Explain(displayName = "Privilege") +public class PrivilegeDesc implements Serializable, Cloneable { + private static final long serialVersionUID = 1L; + + private Privilege privilege; + + private List columns; + + public PrivilegeDesc(Privilege privilege, List columns) { + super(); + this.privilege = privilege; + this.columns = columns; + } + + public PrivilegeDesc() { + super(); + } + + /** + * @return privilege definition + */ + @Explain(displayName = "privilege") + public Privilege getPrivilege() { + return privilege; + } + + /** + * @param privilege + */ + public void setPrivilege(Privilege privilege) { + this.privilege = privilege; + } + + /** + * @return columns on which the given privilege take affect. + */ + @Explain(displayName = "columns") + public List getColumns() { + return columns; + } + + /** + * @param columns + */ + public void setColumns(List columns) { + this.columns = columns; + } + +} Index: ql/src/java/org/apache/hadoop/hive/ql/plan/PrivilegeObjectDesc.java =================================================================== --- ql/src/java/org/apache/hadoop/hive/ql/plan/PrivilegeObjectDesc.java (revision 0) +++ ql/src/java/org/apache/hadoop/hive/ql/plan/PrivilegeObjectDesc.java (revision 0) @@ -0,0 +1,70 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.hadoop.hive.ql.plan; + +import java.util.HashMap; + +@Explain(displayName="privilege subject") +public class PrivilegeObjectDesc { + + private boolean table; + + private String object; + + private HashMap partSpec; + + public PrivilegeObjectDesc(boolean isTable, String object, + HashMap partSpec) { + super(); + this.table = isTable; + this.object = object; + this.partSpec = partSpec; + } + + public PrivilegeObjectDesc() { + } + + @Explain(displayName="is table") + public boolean getTable() { + return table; + } + + public void setTable(boolean isTable) { + this.table = isTable; + } + + @Explain(displayName="object") + public String getObject() { + return object; + } + + public void setObject(String object) { + this.object = object; + } + + @Explain(displayName="partition spec") + public HashMap getPartSpec() { + return partSpec; + } + + public void setPartSpec(HashMap partSpec) { + this.partSpec = partSpec; + } + +} Index: ql/src/java/org/apache/hadoop/hive/ql/plan/RevokeDesc.java =================================================================== --- ql/src/java/org/apache/hadoop/hive/ql/plan/RevokeDesc.java (revision 0) +++ ql/src/java/org/apache/hadoop/hive/ql/plan/RevokeDesc.java (revision 0) @@ -0,0 +1,70 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.hadoop.hive.ql.plan; + +import java.io.Serializable; +import java.util.List; + +@Explain(displayName="Revoke") +public class RevokeDesc extends DDLDesc implements Serializable, Cloneable { + + private static final long serialVersionUID = 1L; + + private List privileges; + + private List principals; + + private PrivilegeObjectDesc privilegeSubjectDesc; + + public RevokeDesc(){ + } + + public RevokeDesc(List privileges, + List principals, PrivilegeObjectDesc privilegeSubjectDesc) { + super(); + this.privileges = privileges; + this.principals = principals; + this.privilegeSubjectDesc = privilegeSubjectDesc; + } + + public List getPrivileges() { + return privileges; + } + + public void setPrivileges(List privileges) { + this.privileges = privileges; + } + + public List getPrincipals() { + return principals; + } + + public void setPrincipals(List principals) { + this.principals = principals; + } + + public PrivilegeObjectDesc getPrivilegeSubjectDesc() { + return privilegeSubjectDesc; + } + + public void setPrivilegeSubjectDesc(PrivilegeObjectDesc privilegeSubjectDesc) { + this.privilegeSubjectDesc = privilegeSubjectDesc; + } + +} Index: ql/src/java/org/apache/hadoop/hive/ql/plan/RoleDDLDesc.java =================================================================== --- ql/src/java/org/apache/hadoop/hive/ql/plan/RoleDDLDesc.java (revision 0) +++ ql/src/java/org/apache/hadoop/hive/ql/plan/RoleDDLDesc.java (revision 0) @@ -0,0 +1,79 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.hadoop.hive.ql.plan; + +import java.io.Serializable; + +@Explain(displayName = "Create Role") +public class RoleDDLDesc extends DDLDesc implements Serializable { + + private static final long serialVersionUID = 1L; + + private String roleName; + + private RoleOperation operation; + + public static enum RoleOperation { + DROP_ROLE("drop_role"), CREATE_ROLE("create_role"); + private String operationName; + + private RoleOperation() { + } + + private RoleOperation(String operationName) { + this.operationName = operationName; + } + + public String getOperationName() { + return operationName; + } + + public String toString () { + return this.operationName; + } + } + + public RoleDDLDesc(){ + } + + public RoleDDLDesc(String roleName, RoleOperation operation) { + super(); + this.roleName = roleName; + this.operation = operation; + } + + @Explain(displayName = "role name") + public String getRoleName() { + return roleName; + } + + public void setRoleName(String roleName) { + this.roleName = roleName; + } + + @Explain(displayName = "role operation") + public RoleOperation getOperation() { + return operation; + } + + public void setOperation(RoleOperation operation) { + this.operation = operation; + } + +} Index: ql/src/java/org/apache/hadoop/hive/ql/plan/ShowGrantDesc.java =================================================================== --- ql/src/java/org/apache/hadoop/hive/ql/plan/ShowGrantDesc.java (revision 0) +++ ql/src/java/org/apache/hadoop/hive/ql/plan/ShowGrantDesc.java (revision 0) @@ -0,0 +1,78 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.hadoop.hive.ql.plan; + +import java.util.List; + +@Explain(displayName="show grant desc") +public class ShowGrantDesc { + + private PrincipalDesc principalDesc; + + private PrivilegeObjectDesc hiveObj; + + private List columns; + + private String resFile; + + public ShowGrantDesc(){ + } + + public ShowGrantDesc(String resFile, PrincipalDesc principalDesc, + PrivilegeObjectDesc subjectObj, List columns) { + this.resFile = resFile; + this.principalDesc = principalDesc; + this.hiveObj = subjectObj; + this.columns = columns; + } + + @Explain(displayName="principal desc") + public PrincipalDesc getPrincipalDesc() { + return principalDesc; + } + + public void setPrincipalDesc(PrincipalDesc principalDesc) { + this.principalDesc = principalDesc; + } + + @Explain(displayName="object") + public PrivilegeObjectDesc getHiveObj() { + return hiveObj; + } + + public void setHiveObj(PrivilegeObjectDesc subjectObj) { + this.hiveObj = subjectObj; + } + + public String getResFile() { + return resFile; + } + + public void setResFile(String resFile) { + this.resFile = resFile; + } + + public List getColumns() { + return columns; + } + + public void setColumns(List columns) { + this.columns = columns; + } + +} Index: ql/src/java/org/apache/hadoop/hive/ql/security/Authenticator.java =================================================================== --- ql/src/java/org/apache/hadoop/hive/ql/security/Authenticator.java (revision 0) +++ ql/src/java/org/apache/hadoop/hive/ql/security/Authenticator.java (revision 0) @@ -0,0 +1,34 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.hadoop.hive.ql.security; + +import java.util.List; +import java.util.Properties; + +public interface Authenticator { + + public boolean init(Properties props); + + public String getUserName(); + + public List getGroupNames(); + + public boolean detroy(); + +} Index: ql/src/java/org/apache/hadoop/hive/ql/security/authorization/AuthorizationFactory.java =================================================================== --- ql/src/java/org/apache/hadoop/hive/ql/security/authorization/AuthorizationFactory.java (revision 0) +++ ql/src/java/org/apache/hadoop/hive/ql/security/authorization/AuthorizationFactory.java (revision 0) @@ -0,0 +1,54 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.hadoop.hive.ql.security.authorization; + +import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.hive.conf.HiveConf; +import org.apache.hadoop.hive.ql.metadata.HiveException; + +public class AuthorizationFactory { + + @SuppressWarnings("unchecked") + public AuthorizationProviderManager getAuthorizeProviderManager( + Configuration conf) throws HiveException { + + String clsStr = HiveConf.getVar(conf, + HiveConf.ConfVars.HIVE_AUTHORIZATION_MANAGER); + + AuthorizationProviderManager ret = null; + try { + Class cls = null; + if (clsStr == null || clsStr.trim().equals("")) { + cls = DefaultAuthorizationProviderManager.class; + } else { + cls = (Class) Class + .forName(clsStr); + } + if (ret != null) { + ret = cls.newInstance(); + ret.init(conf); + } + } catch (Exception e) { + throw new HiveException(e); + } + + return ret; + } + +} Index: ql/src/java/org/apache/hadoop/hive/ql/security/authorization/AuthorizationProvider.java =================================================================== --- ql/src/java/org/apache/hadoop/hive/ql/security/authorization/AuthorizationProvider.java (revision 0) +++ ql/src/java/org/apache/hadoop/hive/ql/security/authorization/AuthorizationProvider.java (revision 0) @@ -0,0 +1,39 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.hadoop.hive.ql.security.authorization; + +import java.util.List; + +import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.hive.metastore.api.FieldSchema; +import org.apache.hadoop.hive.metastore.api.Partition; +import org.apache.hadoop.hive.metastore.api.Table; +import org.apache.hadoop.hive.ql.metadata.HiveException; + +public interface AuthorizationProvider { + + public void init(Configuration conf) throws HiveException; + + public boolean access(Table table, List privs); + + public boolean access(Partition part, List privs); + + public boolean access(FieldSchema column, List privs); + +} Index: ql/src/java/org/apache/hadoop/hive/ql/security/authorization/AuthorizationProviderManager.java =================================================================== --- ql/src/java/org/apache/hadoop/hive/ql/security/authorization/AuthorizationProviderManager.java (revision 0) +++ ql/src/java/org/apache/hadoop/hive/ql/security/authorization/AuthorizationProviderManager.java (revision 0) @@ -0,0 +1,82 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.hadoop.hive.ql.security.authorization; + +import java.util.ArrayList; +import java.util.List; + +import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.hive.conf.HiveConf; +import org.apache.hadoop.hive.ql.metadata.Hive; +import org.apache.hadoop.hive.ql.metadata.HiveException; +import org.apache.hadoop.hive.ql.security.Authenticator; + +public abstract class AuthorizationProviderManager { + + public static String PROVIDER_LIST_CONF_PREFIX = "hive.security.authorization.providers."; + + protected Authenticator authenticator; + + protected Hive hive_db; + + public void init(Configuration conf) throws HiveException { + hive_db = Hive.get(new HiveConf(conf, AuthorizationProviderManager.class)); + initSelf(conf); + } + + protected abstract void initSelf(Configuration conf) throws HiveException; + + public Authenticator getAuthenticator() { + return authenticator; + } + + public void setAuthenticator(Authenticator authenticator) { + this.authenticator = authenticator; + } + +// public PrivilegeBag getPrivilegeBag(List partitions, +// List
tables, List columns) { +// +// } + + @SuppressWarnings("unchecked") + public List getProviderList( + Class managerImplCls, + Configuration conf) throws HiveException { + String providerList = conf.get(PROVIDER_LIST_CONF_PREFIX + + managerImplCls.getSimpleName().toLowerCase()); + + List ret = new ArrayList(); + if (providerList != null && !providerList.trim().equals("")) { + try { + String[] providers = providerList.split(","); + if (providers != null) { + for (String authStr : providers) { + Class cls = (Class) Class + .forName(authStr); + ret.add(cls.newInstance()); + } + } + } catch (Exception e) { + throw new HiveException(e); + } + } + return ret; + } +} Index: ql/src/java/org/apache/hadoop/hive/ql/security/authorization/DefaultAuthorizationProviderManager.java =================================================================== --- ql/src/java/org/apache/hadoop/hive/ql/security/authorization/DefaultAuthorizationProviderManager.java (revision 0) +++ ql/src/java/org/apache/hadoop/hive/ql/security/authorization/DefaultAuthorizationProviderManager.java (revision 0) @@ -0,0 +1,56 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.hadoop.hive.ql.security.authorization; + +import java.util.List; + +import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.hive.ql.metadata.HiveException; + +public class DefaultAuthorizationProviderManager extends + AuthorizationProviderManager { + + private List authProviders; + + @SuppressWarnings("unchecked") + @Override + public void initSelf(Configuration conf) throws HiveException { + authProviders = super.getProviderList( + DefaultAuthorizationProviderManager.class, conf); + if (authProviders == null || authProviders.size() == 0) { + String[] providers = new String[1]; + providers[0] = HiveAuthorizationProvider.class.getCanonicalName(); + for (String authStr : providers) { + Class cls; + try { + cls = (Class) Class.forName(authStr); + authProviders.add(cls.newInstance()); + } catch (Exception e) { + throw new HiveException(e); + } + } + + for (AuthorizationProvider auth: authProviders) { + auth.init(conf); + } + } + } + + +} Index: ql/src/java/org/apache/hadoop/hive/ql/security/authorization/HDFSAuthorizationProvider.java =================================================================== --- ql/src/java/org/apache/hadoop/hive/ql/security/authorization/HDFSAuthorizationProvider.java (revision 0) +++ ql/src/java/org/apache/hadoop/hive/ql/security/authorization/HDFSAuthorizationProvider.java (revision 0) @@ -0,0 +1,36 @@ +package org.apache.hadoop.hive.ql.security.authorization; + +import java.util.List; + +import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.hive.metastore.api.FieldSchema; +import org.apache.hadoop.hive.metastore.api.Partition; +import org.apache.hadoop.hive.metastore.api.Table; +import org.apache.hadoop.hive.ql.metadata.HiveException; + +public class HDFSAuthorizationProvider implements AuthorizationProvider{ + + @Override + public boolean access(Table table, List privs) { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean access(Partition part, List privs) { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean access(FieldSchema column, List privs) { + return true; + } + + @Override + public void init(Configuration conf) throws HiveException { + // TODO Auto-generated method stub + + } + +} Index: ql/src/java/org/apache/hadoop/hive/ql/security/authorization/HiveAuthorizationProvider.java =================================================================== --- ql/src/java/org/apache/hadoop/hive/ql/security/authorization/HiveAuthorizationProvider.java (revision 0) +++ ql/src/java/org/apache/hadoop/hive/ql/security/authorization/HiveAuthorizationProvider.java (revision 0) @@ -0,0 +1,55 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.hadoop.hive.ql.security.authorization; + +import java.util.List; + +import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.hive.metastore.api.FieldSchema; +import org.apache.hadoop.hive.metastore.api.Partition; +import org.apache.hadoop.hive.metastore.api.Table; +import org.apache.hadoop.hive.ql.metadata.HiveException; + +public class HiveAuthorizationProvider implements AuthorizationProvider { + + @Override + public boolean access(Table table, List privs) { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean access(Partition part, List privs) { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean access(FieldSchema column, List privs) { + // TODO Auto-generated method stub + return false; + } + + @Override + public void init(Configuration conf) throws HiveException { + // TODO Auto-generated method stub + + } + +} Index: ql/src/java/org/apache/hadoop/hive/ql/security/authorization/Privilege.java =================================================================== --- ql/src/java/org/apache/hadoop/hive/ql/security/authorization/Privilege.java (revision 0) +++ ql/src/java/org/apache/hadoop/hive/ql/security/authorization/Privilege.java (revision 0) @@ -0,0 +1,76 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.hadoop.hive.ql.security.authorization; + +public class Privilege { + + private String priv; + + private boolean supportColumnLevel; + + private Privilege(String priv, boolean supportColumnLevel) { + super(); + this.priv = priv; + this.supportColumnLevel = supportColumnLevel; + } + + public Privilege(String priv) { + super(); + this.priv = priv; + this.supportColumnLevel = false; + } + + public String getPriv() { + return priv; + } + + public void setPriv(String priv) { + this.priv = priv; + } + + public boolean getSupportColumnLevel() { + return supportColumnLevel; + } + + public void setSupportColumnLevel(boolean supportColumnLevel) { + this.supportColumnLevel = supportColumnLevel; + } + + public Privilege() { + } + + public static Privilege ALL = new Privilege("All Privileges"); + + public static Privilege ALTER = new Privilege("Alter"); + + public static Privilege CREATE = new Privilege("Create"); + + public static Privilege DROP = new Privilege("Drop"); + + public static Privilege INDEX = new Privilege("Index"); + + public static Privilege LOCK = new Privilege("Lock"); + + public static Privilege SELECT = new Privilege("Select", true); + + public static Privilege SHOW_DATABASE = new Privilege("Show Database"); + + public static Privilege SUPER = new Privilege("Super"); + +} Index: ql/src/java/org/apache/hadoop/hive/ql/security/authorization/PrivilegeRegistry.java =================================================================== --- ql/src/java/org/apache/hadoop/hive/ql/security/authorization/PrivilegeRegistry.java (revision 0) +++ ql/src/java/org/apache/hadoop/hive/ql/security/authorization/PrivilegeRegistry.java (revision 0) @@ -0,0 +1,45 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.hadoop.hive.ql.security.authorization; + +import java.util.HashMap; +import java.util.Map; + +public class PrivilegeRegistry { + + protected static Map Registry = new HashMap(); + + static { + Registry.put(Privilege.ALL.getPriv().toLowerCase(), Privilege.ALL); + Registry.put(Privilege.ALTER.getPriv().toLowerCase(), Privilege.ALTER); + Registry.put(Privilege.CREATE.getPriv().toLowerCase(), Privilege.CREATE); + Registry.put(Privilege.DROP.getPriv().toLowerCase(), Privilege.DROP); + Registry.put(Privilege.INDEX.getPriv().toLowerCase(), Privilege.INDEX); + Registry.put(Privilege.LOCK.getPriv().toLowerCase(), Privilege.LOCK); + Registry.put(Privilege.SELECT.getPriv().toLowerCase(), Privilege.SELECT); + Registry.put(Privilege.SHOW_DATABASE.getPriv().toLowerCase(), + Privilege.SHOW_DATABASE); + Registry.put(Privilege.SUPER.getPriv().toLowerCase(), Privilege.SUPER); + } + + public static Privilege getPrivilege(String privilegeName) { + return Registry.get(privilegeName.toLowerCase()); + } + +}