diff --git build-common.xml build-common.xml index 24fac36..5c9d391 100644 --- build-common.xml +++ build-common.xml @@ -453,6 +453,13 @@ Tests failed! + + + + + + + diff --git build.xml build.xml index 701487d..f41db23 100644 --- build.xml +++ build.xml @@ -126,6 +126,17 @@ + + + + + + + + + + + @@ -206,7 +217,8 @@ - + + diff --git metastore/if/hive_metastore.thrift metastore/if/hive_metastore.thrift index 4f9f53c..ae9d185 100755 --- metastore/if/hive_metastore.thrift +++ metastore/if/hive_metastore.thrift @@ -356,6 +356,25 @@ service ThriftHiveMetastore extends fb303.FacebookService bool grant_privileges(1:PrivilegeBag privileges) throws(1:MetaException o1) bool revoke_privileges(1:PrivilegeBag privileges) throws(1:MetaException o1) + + //Authentication (delegation token) interfaces + + // get metastore server delegation token for use from the map/reduce tasks to authenticate + // to metastore server + string get_delegation_token(1:string renewer_kerberos_principal_name) throws (1:MetaException o1) + + // get metastore server delegation token for use from the map/reduce tasks to authenticate + // to metastore server - this method takes an extra token signature string which is just + // an identifier to associate with the token - this will be used by the token selector code + // to pick the right token given the associated identifier. + string get_delegation_token_with_signature(1:string renewer_kerberos_principal_name, + 2:string token_signature) throws (1:MetaException o1) + + // method to renew delegation token obtained from metastore server + i64 renew_delegation_token(1:string token_str_form) throws (1:MetaException o1) + + // method to cancel delegation token obtained from metastore server + void cancel_delegation_token(1:string token_str_form) throws (1:MetaException o1) } // * Note about the DDL_TIME: When creating or altering a table or a partition, diff --git metastore/src/gen/thrift/gen-cpp/ThriftHiveMetastore.cpp metastore/src/gen/thrift/gen-cpp/ThriftHiveMetastore.cpp index 18f70fc..2638130 100644 --- metastore/src/gen/thrift/gen-cpp/ThriftHiveMetastore.cpp +++ metastore/src/gen/thrift/gen-cpp/ThriftHiveMetastore.cpp @@ -11993,19 +11993,982 @@ uint32_t ThriftHiveMetastore_revoke_privileges_presult::read(::apache::thrift::p return xfer; } +uint32_t ThriftHiveMetastore_get_delegation_token_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->renewer_kerberos_principal_name); + this->__isset.renewer_kerberos_principal_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_delegation_token_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_delegation_token_args"); + xfer += oprot->writeFieldBegin("renewer_kerberos_principal_name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->renewer_kerberos_principal_name); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t ThriftHiveMetastore_get_delegation_token_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_delegation_token_pargs"); + xfer += oprot->writeFieldBegin("renewer_kerberos_principal_name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString((*(this->renewer_kerberos_principal_name))); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t ThriftHiveMetastore_get_delegation_token_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->success); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_delegation_token_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_delegation_token_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRING, 0); + xfer += oprot->writeString(this->success); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t ThriftHiveMetastore_get_delegation_token_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString((*(this->success))); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_delegation_token_with_signature_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->renewer_kerberos_principal_name); + this->__isset.renewer_kerberos_principal_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->token_signature); + this->__isset.token_signature = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_delegation_token_with_signature_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_delegation_token_with_signature_args"); + xfer += oprot->writeFieldBegin("renewer_kerberos_principal_name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->renewer_kerberos_principal_name); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("token_signature", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->token_signature); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t ThriftHiveMetastore_get_delegation_token_with_signature_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_delegation_token_with_signature_pargs"); + xfer += oprot->writeFieldBegin("renewer_kerberos_principal_name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString((*(this->renewer_kerberos_principal_name))); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("token_signature", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString((*(this->token_signature))); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t ThriftHiveMetastore_get_delegation_token_with_signature_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->success); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_delegation_token_with_signature_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_delegation_token_with_signature_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRING, 0); + xfer += oprot->writeString(this->success); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t ThriftHiveMetastore_get_delegation_token_with_signature_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString((*(this->success))); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_renew_delegation_token_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->token_str_form); + this->__isset.token_str_form = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_renew_delegation_token_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("ThriftHiveMetastore_renew_delegation_token_args"); + xfer += oprot->writeFieldBegin("token_str_form", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->token_str_form); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t ThriftHiveMetastore_renew_delegation_token_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("ThriftHiveMetastore_renew_delegation_token_pargs"); + xfer += oprot->writeFieldBegin("token_str_form", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString((*(this->token_str_form))); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t ThriftHiveMetastore_renew_delegation_token_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->success); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_renew_delegation_token_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_renew_delegation_token_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_I64, 0); + xfer += oprot->writeI64(this->success); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t ThriftHiveMetastore_renew_delegation_token_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64((*(this->success))); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_cancel_delegation_token_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->token_str_form); + this->__isset.token_str_form = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_cancel_delegation_token_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("ThriftHiveMetastore_cancel_delegation_token_args"); + xfer += oprot->writeFieldBegin("token_str_form", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->token_str_form); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t ThriftHiveMetastore_cancel_delegation_token_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("ThriftHiveMetastore_cancel_delegation_token_pargs"); + xfer += oprot->writeFieldBegin("token_str_form", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString((*(this->token_str_form))); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t ThriftHiveMetastore_cancel_delegation_token_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_cancel_delegation_token_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_cancel_delegation_token_result"); + + if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t ThriftHiveMetastore_cancel_delegation_token_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + void ThriftHiveMetastoreClient::create_database(const Database& database) { - send_create_database(database); - recv_create_database(); + send_create_database(database); + recv_create_database(); +} + +void ThriftHiveMetastoreClient::send_create_database(const Database& database) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("create_database", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_create_database_pargs args; + args.database = &database; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->flush(); + oprot_->getTransport()->writeEnd(); +} + +void ThriftHiveMetastoreClient::recv_create_database() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::INVALID_MESSAGE_TYPE); + } + if (fname.compare("create_database") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::WRONG_METHOD_NAME); + } + ThriftHiveMetastore_create_database_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + if (result.__isset.o3) { + throw result.o3; + } + return; +} + +void ThriftHiveMetastoreClient::get_database(Database& _return, const std::string& name) +{ + send_get_database(name); + recv_get_database(_return); +} + +void ThriftHiveMetastoreClient::send_get_database(const std::string& name) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("get_database", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_database_pargs args; + args.name = &name; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->flush(); + oprot_->getTransport()->writeEnd(); +} + +void ThriftHiveMetastoreClient::recv_get_database(Database& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::INVALID_MESSAGE_TYPE); + } + if (fname.compare("get_database") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::WRONG_METHOD_NAME); + } + ThriftHiveMetastore_get_database_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_database failed: unknown result"); +} + +void ThriftHiveMetastoreClient::drop_database(const std::string& name, const bool deleteData) +{ + send_drop_database(name, deleteData); + recv_drop_database(); +} + +void ThriftHiveMetastoreClient::send_drop_database(const std::string& name, const bool deleteData) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("drop_database", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_drop_database_pargs args; + args.name = &name; + args.deleteData = &deleteData; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->flush(); + oprot_->getTransport()->writeEnd(); +} + +void ThriftHiveMetastoreClient::recv_drop_database() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::INVALID_MESSAGE_TYPE); + } + if (fname.compare("drop_database") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::WRONG_METHOD_NAME); + } + ThriftHiveMetastore_drop_database_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + if (result.__isset.o3) { + throw result.o3; + } + return; +} + +void ThriftHiveMetastoreClient::get_databases(std::vector & _return, const std::string& pattern) +{ + send_get_databases(pattern); + recv_get_databases(_return); +} + +void ThriftHiveMetastoreClient::send_get_databases(const std::string& pattern) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("get_databases", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_databases_pargs args; + args.pattern = &pattern; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->flush(); + oprot_->getTransport()->writeEnd(); +} + +void ThriftHiveMetastoreClient::recv_get_databases(std::vector & _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::INVALID_MESSAGE_TYPE); + } + if (fname.compare("get_databases") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::WRONG_METHOD_NAME); + } + ThriftHiveMetastore_get_databases_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_databases failed: unknown result"); +} + +void ThriftHiveMetastoreClient::get_all_databases(std::vector & _return) +{ + send_get_all_databases(); + recv_get_all_databases(_return); } -void ThriftHiveMetastoreClient::send_create_database(const Database& database) +void ThriftHiveMetastoreClient::send_get_all_databases() { int32_t cseqid = 0; - oprot_->writeMessageBegin("create_database", ::apache::thrift::protocol::T_CALL, cseqid); + oprot_->writeMessageBegin("get_all_databases", ::apache::thrift::protocol::T_CALL, cseqid); - ThriftHiveMetastore_create_database_pargs args; - args.database = &database; + ThriftHiveMetastore_get_all_databases_pargs args; args.write(oprot_); oprot_->writeMessageEnd(); @@ -12013,7 +12976,7 @@ void ThriftHiveMetastoreClient::send_create_database(const Database& database) oprot_->getTransport()->writeEnd(); } -void ThriftHiveMetastoreClient::recv_create_database() +void ThriftHiveMetastoreClient::recv_get_all_databases(std::vector & _return) { int32_t rseqid = 0; @@ -12034,42 +12997,42 @@ void ThriftHiveMetastoreClient::recv_create_database() iprot_->getTransport()->readEnd(); throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::INVALID_MESSAGE_TYPE); } - if (fname.compare("create_database") != 0) { + if (fname.compare("get_all_databases") != 0) { iprot_->skip(::apache::thrift::protocol::T_STRUCT); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::WRONG_METHOD_NAME); } - ThriftHiveMetastore_create_database_presult result; + ThriftHiveMetastore_get_all_databases_presult result; + result.success = &_return; result.read(iprot_); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); + if (result.__isset.success) { + // _return pointer has now been filled + return; + } if (result.__isset.o1) { throw result.o1; } - if (result.__isset.o2) { - throw result.o2; - } - if (result.__isset.o3) { - throw result.o3; - } - return; + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_all_databases failed: unknown result"); } -void ThriftHiveMetastoreClient::get_database(Database& _return, const std::string& name) +void ThriftHiveMetastoreClient::alter_database(const std::string& dbname, const Database& db) { - send_get_database(name); - recv_get_database(_return); + send_alter_database(dbname, db); + recv_alter_database(); } -void ThriftHiveMetastoreClient::send_get_database(const std::string& name) +void ThriftHiveMetastoreClient::send_alter_database(const std::string& dbname, const Database& db) { int32_t cseqid = 0; - oprot_->writeMessageBegin("get_database", ::apache::thrift::protocol::T_CALL, cseqid); + oprot_->writeMessageBegin("alter_database", ::apache::thrift::protocol::T_CALL, cseqid); - ThriftHiveMetastore_get_database_pargs args; - args.name = &name; + ThriftHiveMetastore_alter_database_pargs args; + args.dbname = &dbname; + args.db = &db; args.write(oprot_); oprot_->writeMessageEnd(); @@ -12077,7 +13040,7 @@ void ThriftHiveMetastoreClient::send_get_database(const std::string& name) oprot_->getTransport()->writeEnd(); } -void ThriftHiveMetastoreClient::recv_get_database(Database& _return) +void ThriftHiveMetastoreClient::recv_alter_database() { int32_t rseqid = 0; @@ -12098,45 +13061,39 @@ void ThriftHiveMetastoreClient::recv_get_database(Database& _return) iprot_->getTransport()->readEnd(); throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::INVALID_MESSAGE_TYPE); } - if (fname.compare("get_database") != 0) { + if (fname.compare("alter_database") != 0) { iprot_->skip(::apache::thrift::protocol::T_STRUCT); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::WRONG_METHOD_NAME); } - ThriftHiveMetastore_get_database_presult result; - result.success = &_return; + ThriftHiveMetastore_alter_database_presult result; result.read(iprot_); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); - if (result.__isset.success) { - // _return pointer has now been filled - return; - } if (result.__isset.o1) { throw result.o1; } if (result.__isset.o2) { throw result.o2; } - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_database failed: unknown result"); + return; } -void ThriftHiveMetastoreClient::drop_database(const std::string& name, const bool deleteData) +void ThriftHiveMetastoreClient::get_type(Type& _return, const std::string& name) { - send_drop_database(name, deleteData); - recv_drop_database(); + send_get_type(name); + recv_get_type(_return); } -void ThriftHiveMetastoreClient::send_drop_database(const std::string& name, const bool deleteData) +void ThriftHiveMetastoreClient::send_get_type(const std::string& name) { int32_t cseqid = 0; - oprot_->writeMessageBegin("drop_database", ::apache::thrift::protocol::T_CALL, cseqid); + oprot_->writeMessageBegin("get_type", ::apache::thrift::protocol::T_CALL, cseqid); - ThriftHiveMetastore_drop_database_pargs args; + ThriftHiveMetastore_get_type_pargs args; args.name = &name; - args.deleteData = &deleteData; args.write(oprot_); oprot_->writeMessageEnd(); @@ -12144,7 +13101,7 @@ void ThriftHiveMetastoreClient::send_drop_database(const std::string& name, cons oprot_->getTransport()->writeEnd(); } -void ThriftHiveMetastoreClient::recv_drop_database() +void ThriftHiveMetastoreClient::recv_get_type(Type& _return) { int32_t rseqid = 0; @@ -12165,42 +13122,44 @@ void ThriftHiveMetastoreClient::recv_drop_database() iprot_->getTransport()->readEnd(); throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::INVALID_MESSAGE_TYPE); } - if (fname.compare("drop_database") != 0) { + if (fname.compare("get_type") != 0) { iprot_->skip(::apache::thrift::protocol::T_STRUCT); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::WRONG_METHOD_NAME); } - ThriftHiveMetastore_drop_database_presult result; + ThriftHiveMetastore_get_type_presult result; + result.success = &_return; result.read(iprot_); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); + if (result.__isset.success) { + // _return pointer has now been filled + return; + } if (result.__isset.o1) { throw result.o1; } if (result.__isset.o2) { throw result.o2; } - if (result.__isset.o3) { - throw result.o3; - } - return; + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_type failed: unknown result"); } -void ThriftHiveMetastoreClient::get_databases(std::vector & _return, const std::string& pattern) +bool ThriftHiveMetastoreClient::create_type(const Type& type) { - send_get_databases(pattern); - recv_get_databases(_return); + send_create_type(type); + return recv_create_type(); } -void ThriftHiveMetastoreClient::send_get_databases(const std::string& pattern) +void ThriftHiveMetastoreClient::send_create_type(const Type& type) { int32_t cseqid = 0; - oprot_->writeMessageBegin("get_databases", ::apache::thrift::protocol::T_CALL, cseqid); + oprot_->writeMessageBegin("create_type", ::apache::thrift::protocol::T_CALL, cseqid); - ThriftHiveMetastore_get_databases_pargs args; - args.pattern = &pattern; + ThriftHiveMetastore_create_type_pargs args; + args.type = &type; args.write(oprot_); oprot_->writeMessageEnd(); @@ -12208,7 +13167,7 @@ void ThriftHiveMetastoreClient::send_get_databases(const std::string& pattern) oprot_->getTransport()->writeEnd(); } -void ThriftHiveMetastoreClient::recv_get_databases(std::vector & _return) +bool ThriftHiveMetastoreClient::recv_create_type() { int32_t rseqid = 0; @@ -12229,40 +13188,47 @@ void ThriftHiveMetastoreClient::recv_get_databases(std::vector & _r iprot_->getTransport()->readEnd(); throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::INVALID_MESSAGE_TYPE); } - if (fname.compare("get_databases") != 0) { + if (fname.compare("create_type") != 0) { iprot_->skip(::apache::thrift::protocol::T_STRUCT); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::WRONG_METHOD_NAME); } - ThriftHiveMetastore_get_databases_presult result; + bool _return; + ThriftHiveMetastore_create_type_presult result; result.success = &_return; result.read(iprot_); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); if (result.__isset.success) { - // _return pointer has now been filled - return; + return _return; } if (result.__isset.o1) { throw result.o1; } - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_databases failed: unknown result"); + if (result.__isset.o2) { + throw result.o2; + } + if (result.__isset.o3) { + throw result.o3; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "create_type failed: unknown result"); } -void ThriftHiveMetastoreClient::get_all_databases(std::vector & _return) +bool ThriftHiveMetastoreClient::drop_type(const std::string& type) { - send_get_all_databases(); - recv_get_all_databases(_return); + send_drop_type(type); + return recv_drop_type(); } -void ThriftHiveMetastoreClient::send_get_all_databases() +void ThriftHiveMetastoreClient::send_drop_type(const std::string& type) { int32_t cseqid = 0; - oprot_->writeMessageBegin("get_all_databases", ::apache::thrift::protocol::T_CALL, cseqid); + oprot_->writeMessageBegin("drop_type", ::apache::thrift::protocol::T_CALL, cseqid); - ThriftHiveMetastore_get_all_databases_pargs args; + ThriftHiveMetastore_drop_type_pargs args; + args.type = &type; args.write(oprot_); oprot_->writeMessageEnd(); @@ -12270,7 +13236,7 @@ void ThriftHiveMetastoreClient::send_get_all_databases() oprot_->getTransport()->writeEnd(); } -void ThriftHiveMetastoreClient::recv_get_all_databases(std::vector & _return) +bool ThriftHiveMetastoreClient::recv_drop_type() { int32_t rseqid = 0; @@ -12291,42 +13257,44 @@ void ThriftHiveMetastoreClient::recv_get_all_databases(std::vector iprot_->getTransport()->readEnd(); throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::INVALID_MESSAGE_TYPE); } - if (fname.compare("get_all_databases") != 0) { + if (fname.compare("drop_type") != 0) { iprot_->skip(::apache::thrift::protocol::T_STRUCT); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::WRONG_METHOD_NAME); } - ThriftHiveMetastore_get_all_databases_presult result; + bool _return; + ThriftHiveMetastore_drop_type_presult result; result.success = &_return; result.read(iprot_); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); if (result.__isset.success) { - // _return pointer has now been filled - return; + return _return; } if (result.__isset.o1) { throw result.o1; } - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_all_databases failed: unknown result"); + if (result.__isset.o2) { + throw result.o2; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "drop_type failed: unknown result"); } -void ThriftHiveMetastoreClient::alter_database(const std::string& dbname, const Database& db) +void ThriftHiveMetastoreClient::get_type_all(std::map & _return, const std::string& name) { - send_alter_database(dbname, db); - recv_alter_database(); + send_get_type_all(name); + recv_get_type_all(_return); } -void ThriftHiveMetastoreClient::send_alter_database(const std::string& dbname, const Database& db) +void ThriftHiveMetastoreClient::send_get_type_all(const std::string& name) { int32_t cseqid = 0; - oprot_->writeMessageBegin("alter_database", ::apache::thrift::protocol::T_CALL, cseqid); + oprot_->writeMessageBegin("get_type_all", ::apache::thrift::protocol::T_CALL, cseqid); - ThriftHiveMetastore_alter_database_pargs args; - args.dbname = &dbname; - args.db = &db; + ThriftHiveMetastore_get_type_all_pargs args; + args.name = &name; args.write(oprot_); oprot_->writeMessageEnd(); @@ -12334,7 +13302,7 @@ void ThriftHiveMetastoreClient::send_alter_database(const std::string& dbname, c oprot_->getTransport()->writeEnd(); } -void ThriftHiveMetastoreClient::recv_alter_database() +void ThriftHiveMetastoreClient::recv_get_type_all(std::map & _return) { int32_t rseqid = 0; @@ -12355,39 +13323,42 @@ void ThriftHiveMetastoreClient::recv_alter_database() iprot_->getTransport()->readEnd(); throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::INVALID_MESSAGE_TYPE); } - if (fname.compare("alter_database") != 0) { + if (fname.compare("get_type_all") != 0) { iprot_->skip(::apache::thrift::protocol::T_STRUCT); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::WRONG_METHOD_NAME); } - ThriftHiveMetastore_alter_database_presult result; + ThriftHiveMetastore_get_type_all_presult result; + result.success = &_return; result.read(iprot_); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); - if (result.__isset.o1) { - throw result.o1; + if (result.__isset.success) { + // _return pointer has now been filled + return; } if (result.__isset.o2) { throw result.o2; } - return; + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_type_all failed: unknown result"); } -void ThriftHiveMetastoreClient::get_type(Type& _return, const std::string& name) +void ThriftHiveMetastoreClient::get_fields(std::vector & _return, const std::string& db_name, const std::string& table_name) { - send_get_type(name); - recv_get_type(_return); + send_get_fields(db_name, table_name); + recv_get_fields(_return); } -void ThriftHiveMetastoreClient::send_get_type(const std::string& name) +void ThriftHiveMetastoreClient::send_get_fields(const std::string& db_name, const std::string& table_name) { int32_t cseqid = 0; - oprot_->writeMessageBegin("get_type", ::apache::thrift::protocol::T_CALL, cseqid); + oprot_->writeMessageBegin("get_fields", ::apache::thrift::protocol::T_CALL, cseqid); - ThriftHiveMetastore_get_type_pargs args; - args.name = &name; + ThriftHiveMetastore_get_fields_pargs args; + args.db_name = &db_name; + args.table_name = &table_name; args.write(oprot_); oprot_->writeMessageEnd(); @@ -12395,7 +13366,7 @@ void ThriftHiveMetastoreClient::send_get_type(const std::string& name) oprot_->getTransport()->writeEnd(); } -void ThriftHiveMetastoreClient::recv_get_type(Type& _return) +void ThriftHiveMetastoreClient::recv_get_fields(std::vector & _return) { int32_t rseqid = 0; @@ -12416,13 +13387,13 @@ void ThriftHiveMetastoreClient::recv_get_type(Type& _return) iprot_->getTransport()->readEnd(); throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::INVALID_MESSAGE_TYPE); } - if (fname.compare("get_type") != 0) { + if (fname.compare("get_fields") != 0) { iprot_->skip(::apache::thrift::protocol::T_STRUCT); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::WRONG_METHOD_NAME); } - ThriftHiveMetastore_get_type_presult result; + ThriftHiveMetastore_get_fields_presult result; result.success = &_return; result.read(iprot_); iprot_->readMessageEnd(); @@ -12438,22 +13409,26 @@ void ThriftHiveMetastoreClient::recv_get_type(Type& _return) if (result.__isset.o2) { throw result.o2; } - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_type failed: unknown result"); + if (result.__isset.o3) { + throw result.o3; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_fields failed: unknown result"); } -bool ThriftHiveMetastoreClient::create_type(const Type& type) +void ThriftHiveMetastoreClient::get_schema(std::vector & _return, const std::string& db_name, const std::string& table_name) { - send_create_type(type); - return recv_create_type(); + send_get_schema(db_name, table_name); + recv_get_schema(_return); } -void ThriftHiveMetastoreClient::send_create_type(const Type& type) +void ThriftHiveMetastoreClient::send_get_schema(const std::string& db_name, const std::string& table_name) { int32_t cseqid = 0; - oprot_->writeMessageBegin("create_type", ::apache::thrift::protocol::T_CALL, cseqid); + oprot_->writeMessageBegin("get_schema", ::apache::thrift::protocol::T_CALL, cseqid); - ThriftHiveMetastore_create_type_pargs args; - args.type = &type; + ThriftHiveMetastore_get_schema_pargs args; + args.db_name = &db_name; + args.table_name = &table_name; args.write(oprot_); oprot_->writeMessageEnd(); @@ -12461,7 +13436,7 @@ void ThriftHiveMetastoreClient::send_create_type(const Type& type) oprot_->getTransport()->writeEnd(); } -bool ThriftHiveMetastoreClient::recv_create_type() +void ThriftHiveMetastoreClient::recv_get_schema(std::vector & _return) { int32_t rseqid = 0; @@ -12482,21 +13457,21 @@ bool ThriftHiveMetastoreClient::recv_create_type() iprot_->getTransport()->readEnd(); throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::INVALID_MESSAGE_TYPE); } - if (fname.compare("create_type") != 0) { + if (fname.compare("get_schema") != 0) { iprot_->skip(::apache::thrift::protocol::T_STRUCT); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::WRONG_METHOD_NAME); } - bool _return; - ThriftHiveMetastore_create_type_presult result; + ThriftHiveMetastore_get_schema_presult result; result.success = &_return; result.read(iprot_); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); if (result.__isset.success) { - return _return; + // _return pointer has now been filled + return; } if (result.__isset.o1) { throw result.o1; @@ -12507,22 +13482,22 @@ bool ThriftHiveMetastoreClient::recv_create_type() if (result.__isset.o3) { throw result.o3; } - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "create_type failed: unknown result"); + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_schema failed: unknown result"); } -bool ThriftHiveMetastoreClient::drop_type(const std::string& type) +void ThriftHiveMetastoreClient::create_table(const Table& tbl) { - send_drop_type(type); - return recv_drop_type(); + send_create_table(tbl); + recv_create_table(); } -void ThriftHiveMetastoreClient::send_drop_type(const std::string& type) +void ThriftHiveMetastoreClient::send_create_table(const Table& tbl) { int32_t cseqid = 0; - oprot_->writeMessageBegin("drop_type", ::apache::thrift::protocol::T_CALL, cseqid); + oprot_->writeMessageBegin("create_table", ::apache::thrift::protocol::T_CALL, cseqid); - ThriftHiveMetastore_drop_type_pargs args; - args.type = &type; + ThriftHiveMetastore_create_table_pargs args; + args.tbl = &tbl; args.write(oprot_); oprot_->writeMessageEnd(); @@ -12530,7 +13505,7 @@ void ThriftHiveMetastoreClient::send_drop_type(const std::string& type) oprot_->getTransport()->writeEnd(); } -bool ThriftHiveMetastoreClient::recv_drop_type() +void ThriftHiveMetastoreClient::recv_create_table() { int32_t rseqid = 0; @@ -12551,44 +13526,47 @@ bool ThriftHiveMetastoreClient::recv_drop_type() iprot_->getTransport()->readEnd(); throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::INVALID_MESSAGE_TYPE); } - if (fname.compare("drop_type") != 0) { + if (fname.compare("create_table") != 0) { iprot_->skip(::apache::thrift::protocol::T_STRUCT); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::WRONG_METHOD_NAME); - } - bool _return; - ThriftHiveMetastore_drop_type_presult result; - result.success = &_return; + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::WRONG_METHOD_NAME); + } + ThriftHiveMetastore_create_table_presult result; result.read(iprot_); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); - if (result.__isset.success) { - return _return; - } if (result.__isset.o1) { throw result.o1; } if (result.__isset.o2) { throw result.o2; } - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "drop_type failed: unknown result"); + if (result.__isset.o3) { + throw result.o3; + } + if (result.__isset.o4) { + throw result.o4; + } + return; } -void ThriftHiveMetastoreClient::get_type_all(std::map & _return, const std::string& name) +void ThriftHiveMetastoreClient::drop_table(const std::string& dbname, const std::string& name, const bool deleteData) { - send_get_type_all(name); - recv_get_type_all(_return); + send_drop_table(dbname, name, deleteData); + recv_drop_table(); } -void ThriftHiveMetastoreClient::send_get_type_all(const std::string& name) +void ThriftHiveMetastoreClient::send_drop_table(const std::string& dbname, const std::string& name, const bool deleteData) { int32_t cseqid = 0; - oprot_->writeMessageBegin("get_type_all", ::apache::thrift::protocol::T_CALL, cseqid); + oprot_->writeMessageBegin("drop_table", ::apache::thrift::protocol::T_CALL, cseqid); - ThriftHiveMetastore_get_type_all_pargs args; + ThriftHiveMetastore_drop_table_pargs args; + args.dbname = &dbname; args.name = &name; + args.deleteData = &deleteData; args.write(oprot_); oprot_->writeMessageEnd(); @@ -12596,7 +13574,7 @@ void ThriftHiveMetastoreClient::send_get_type_all(const std::string& name) oprot_->getTransport()->writeEnd(); } -void ThriftHiveMetastoreClient::recv_get_type_all(std::map & _return) +void ThriftHiveMetastoreClient::recv_drop_table() { int32_t rseqid = 0; @@ -12617,42 +13595,40 @@ void ThriftHiveMetastoreClient::recv_get_type_all(std::map & iprot_->getTransport()->readEnd(); throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::INVALID_MESSAGE_TYPE); } - if (fname.compare("get_type_all") != 0) { + if (fname.compare("drop_table") != 0) { iprot_->skip(::apache::thrift::protocol::T_STRUCT); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::WRONG_METHOD_NAME); } - ThriftHiveMetastore_get_type_all_presult result; - result.success = &_return; + ThriftHiveMetastore_drop_table_presult result; result.read(iprot_); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); - if (result.__isset.success) { - // _return pointer has now been filled - return; + if (result.__isset.o1) { + throw result.o1; } - if (result.__isset.o2) { - throw result.o2; + if (result.__isset.o3) { + throw result.o3; } - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_type_all failed: unknown result"); + return; } -void ThriftHiveMetastoreClient::get_fields(std::vector & _return, const std::string& db_name, const std::string& table_name) +void ThriftHiveMetastoreClient::get_tables(std::vector & _return, const std::string& db_name, const std::string& pattern) { - send_get_fields(db_name, table_name); - recv_get_fields(_return); + send_get_tables(db_name, pattern); + recv_get_tables(_return); } -void ThriftHiveMetastoreClient::send_get_fields(const std::string& db_name, const std::string& table_name) +void ThriftHiveMetastoreClient::send_get_tables(const std::string& db_name, const std::string& pattern) { int32_t cseqid = 0; - oprot_->writeMessageBegin("get_fields", ::apache::thrift::protocol::T_CALL, cseqid); + oprot_->writeMessageBegin("get_tables", ::apache::thrift::protocol::T_CALL, cseqid); - ThriftHiveMetastore_get_fields_pargs args; + ThriftHiveMetastore_get_tables_pargs args; args.db_name = &db_name; - args.table_name = &table_name; + args.pattern = &pattern; args.write(oprot_); oprot_->writeMessageEnd(); @@ -12660,7 +13636,7 @@ void ThriftHiveMetastoreClient::send_get_fields(const std::string& db_name, cons oprot_->getTransport()->writeEnd(); } -void ThriftHiveMetastoreClient::recv_get_fields(std::vector & _return) +void ThriftHiveMetastoreClient::recv_get_tables(std::vector & _return) { int32_t rseqid = 0; @@ -12681,13 +13657,13 @@ void ThriftHiveMetastoreClient::recv_get_fields(std::vector & _retu iprot_->getTransport()->readEnd(); throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::INVALID_MESSAGE_TYPE); } - if (fname.compare("get_fields") != 0) { + if (fname.compare("get_tables") != 0) { iprot_->skip(::apache::thrift::protocol::T_STRUCT); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::WRONG_METHOD_NAME); } - ThriftHiveMetastore_get_fields_presult result; + ThriftHiveMetastore_get_tables_presult result; result.success = &_return; result.read(iprot_); iprot_->readMessageEnd(); @@ -12700,29 +13676,22 @@ void ThriftHiveMetastoreClient::recv_get_fields(std::vector & _retu if (result.__isset.o1) { throw result.o1; } - if (result.__isset.o2) { - throw result.o2; - } - if (result.__isset.o3) { - throw result.o3; - } - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_fields failed: unknown result"); + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_tables failed: unknown result"); } -void ThriftHiveMetastoreClient::get_schema(std::vector & _return, const std::string& db_name, const std::string& table_name) +void ThriftHiveMetastoreClient::get_all_tables(std::vector & _return, const std::string& db_name) { - send_get_schema(db_name, table_name); - recv_get_schema(_return); + send_get_all_tables(db_name); + recv_get_all_tables(_return); } -void ThriftHiveMetastoreClient::send_get_schema(const std::string& db_name, const std::string& table_name) +void ThriftHiveMetastoreClient::send_get_all_tables(const std::string& db_name) { int32_t cseqid = 0; - oprot_->writeMessageBegin("get_schema", ::apache::thrift::protocol::T_CALL, cseqid); + oprot_->writeMessageBegin("get_all_tables", ::apache::thrift::protocol::T_CALL, cseqid); - ThriftHiveMetastore_get_schema_pargs args; + ThriftHiveMetastore_get_all_tables_pargs args; args.db_name = &db_name; - args.table_name = &table_name; args.write(oprot_); oprot_->writeMessageEnd(); @@ -12730,7 +13699,7 @@ void ThriftHiveMetastoreClient::send_get_schema(const std::string& db_name, cons oprot_->getTransport()->writeEnd(); } -void ThriftHiveMetastoreClient::recv_get_schema(std::vector & _return) +void ThriftHiveMetastoreClient::recv_get_all_tables(std::vector & _return) { int32_t rseqid = 0; @@ -12751,13 +13720,13 @@ void ThriftHiveMetastoreClient::recv_get_schema(std::vector & _retu iprot_->getTransport()->readEnd(); throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::INVALID_MESSAGE_TYPE); } - if (fname.compare("get_schema") != 0) { + if (fname.compare("get_all_tables") != 0) { iprot_->skip(::apache::thrift::protocol::T_STRUCT); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::WRONG_METHOD_NAME); } - ThriftHiveMetastore_get_schema_presult result; + ThriftHiveMetastore_get_all_tables_presult result; result.success = &_return; result.read(iprot_); iprot_->readMessageEnd(); @@ -12770,28 +13739,23 @@ void ThriftHiveMetastoreClient::recv_get_schema(std::vector & _retu if (result.__isset.o1) { throw result.o1; } - if (result.__isset.o2) { - throw result.o2; - } - if (result.__isset.o3) { - throw result.o3; - } - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_schema failed: unknown result"); + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_all_tables failed: unknown result"); } -void ThriftHiveMetastoreClient::create_table(const Table& tbl) +void ThriftHiveMetastoreClient::get_table(Table& _return, const std::string& dbname, const std::string& tbl_name) { - send_create_table(tbl); - recv_create_table(); + send_get_table(dbname, tbl_name); + recv_get_table(_return); } -void ThriftHiveMetastoreClient::send_create_table(const Table& tbl) +void ThriftHiveMetastoreClient::send_get_table(const std::string& dbname, const std::string& tbl_name) { int32_t cseqid = 0; - oprot_->writeMessageBegin("create_table", ::apache::thrift::protocol::T_CALL, cseqid); + oprot_->writeMessageBegin("get_table", ::apache::thrift::protocol::T_CALL, cseqid); - ThriftHiveMetastore_create_table_pargs args; - args.tbl = &tbl; + ThriftHiveMetastore_get_table_pargs args; + args.dbname = &dbname; + args.tbl_name = &tbl_name; args.write(oprot_); oprot_->writeMessageEnd(); @@ -12799,7 +13763,7 @@ void ThriftHiveMetastoreClient::send_create_table(const Table& tbl) oprot_->getTransport()->writeEnd(); } -void ThriftHiveMetastoreClient::recv_create_table() +void ThriftHiveMetastoreClient::recv_get_table(Table& _return) { int32_t rseqid = 0; @@ -12820,47 +13784,46 @@ void ThriftHiveMetastoreClient::recv_create_table() iprot_->getTransport()->readEnd(); throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::INVALID_MESSAGE_TYPE); } - if (fname.compare("create_table") != 0) { + if (fname.compare("get_table") != 0) { iprot_->skip(::apache::thrift::protocol::T_STRUCT); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::WRONG_METHOD_NAME); } - ThriftHiveMetastore_create_table_presult result; + ThriftHiveMetastore_get_table_presult result; + result.success = &_return; result.read(iprot_); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); + if (result.__isset.success) { + // _return pointer has now been filled + return; + } if (result.__isset.o1) { throw result.o1; } if (result.__isset.o2) { throw result.o2; } - if (result.__isset.o3) { - throw result.o3; - } - if (result.__isset.o4) { - throw result.o4; - } - return; + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_table failed: unknown result"); } -void ThriftHiveMetastoreClient::drop_table(const std::string& dbname, const std::string& name, const bool deleteData) +void ThriftHiveMetastoreClient::alter_table(const std::string& dbname, const std::string& tbl_name, const Table& new_tbl) { - send_drop_table(dbname, name, deleteData); - recv_drop_table(); + send_alter_table(dbname, tbl_name, new_tbl); + recv_alter_table(); } -void ThriftHiveMetastoreClient::send_drop_table(const std::string& dbname, const std::string& name, const bool deleteData) +void ThriftHiveMetastoreClient::send_alter_table(const std::string& dbname, const std::string& tbl_name, const Table& new_tbl) { int32_t cseqid = 0; - oprot_->writeMessageBegin("drop_table", ::apache::thrift::protocol::T_CALL, cseqid); + oprot_->writeMessageBegin("alter_table", ::apache::thrift::protocol::T_CALL, cseqid); - ThriftHiveMetastore_drop_table_pargs args; + ThriftHiveMetastore_alter_table_pargs args; args.dbname = &dbname; - args.name = &name; - args.deleteData = &deleteData; + args.tbl_name = &tbl_name; + args.new_tbl = &new_tbl; args.write(oprot_); oprot_->writeMessageEnd(); @@ -12868,7 +13831,7 @@ void ThriftHiveMetastoreClient::send_drop_table(const std::string& dbname, const oprot_->getTransport()->writeEnd(); } -void ThriftHiveMetastoreClient::recv_drop_table() +void ThriftHiveMetastoreClient::recv_alter_table() { int32_t rseqid = 0; @@ -12889,13 +13852,13 @@ void ThriftHiveMetastoreClient::recv_drop_table() iprot_->getTransport()->readEnd(); throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::INVALID_MESSAGE_TYPE); } - if (fname.compare("drop_table") != 0) { + if (fname.compare("alter_table") != 0) { iprot_->skip(::apache::thrift::protocol::T_STRUCT); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::WRONG_METHOD_NAME); } - ThriftHiveMetastore_drop_table_presult result; + ThriftHiveMetastore_alter_table_presult result; result.read(iprot_); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); @@ -12903,26 +13866,25 @@ void ThriftHiveMetastoreClient::recv_drop_table() if (result.__isset.o1) { throw result.o1; } - if (result.__isset.o3) { - throw result.o3; + if (result.__isset.o2) { + throw result.o2; } return; } -void ThriftHiveMetastoreClient::get_tables(std::vector & _return, const std::string& db_name, const std::string& pattern) +void ThriftHiveMetastoreClient::add_partition(Partition& _return, const Partition& new_part) { - send_get_tables(db_name, pattern); - recv_get_tables(_return); + send_add_partition(new_part); + recv_add_partition(_return); } -void ThriftHiveMetastoreClient::send_get_tables(const std::string& db_name, const std::string& pattern) +void ThriftHiveMetastoreClient::send_add_partition(const Partition& new_part) { int32_t cseqid = 0; - oprot_->writeMessageBegin("get_tables", ::apache::thrift::protocol::T_CALL, cseqid); + oprot_->writeMessageBegin("add_partition", ::apache::thrift::protocol::T_CALL, cseqid); - ThriftHiveMetastore_get_tables_pargs args; - args.db_name = &db_name; - args.pattern = &pattern; + ThriftHiveMetastore_add_partition_pargs args; + args.new_part = &new_part; args.write(oprot_); oprot_->writeMessageEnd(); @@ -12930,7 +13892,7 @@ void ThriftHiveMetastoreClient::send_get_tables(const std::string& db_name, cons oprot_->getTransport()->writeEnd(); } -void ThriftHiveMetastoreClient::recv_get_tables(std::vector & _return) +void ThriftHiveMetastoreClient::recv_add_partition(Partition& _return) { int32_t rseqid = 0; @@ -12951,13 +13913,13 @@ void ThriftHiveMetastoreClient::recv_get_tables(std::vector & _retu iprot_->getTransport()->readEnd(); throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::INVALID_MESSAGE_TYPE); } - if (fname.compare("get_tables") != 0) { + if (fname.compare("add_partition") != 0) { iprot_->skip(::apache::thrift::protocol::T_STRUCT); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::WRONG_METHOD_NAME); } - ThriftHiveMetastore_get_tables_presult result; + ThriftHiveMetastore_add_partition_presult result; result.success = &_return; result.read(iprot_); iprot_->readMessageEnd(); @@ -12970,22 +13932,30 @@ void ThriftHiveMetastoreClient::recv_get_tables(std::vector & _retu if (result.__isset.o1) { throw result.o1; } - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_tables failed: unknown result"); + if (result.__isset.o2) { + throw result.o2; + } + if (result.__isset.o3) { + throw result.o3; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "add_partition failed: unknown result"); } -void ThriftHiveMetastoreClient::get_all_tables(std::vector & _return, const std::string& db_name) +void ThriftHiveMetastoreClient::append_partition(Partition& _return, const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals) { - send_get_all_tables(db_name); - recv_get_all_tables(_return); + send_append_partition(db_name, tbl_name, part_vals); + recv_append_partition(_return); } -void ThriftHiveMetastoreClient::send_get_all_tables(const std::string& db_name) +void ThriftHiveMetastoreClient::send_append_partition(const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals) { int32_t cseqid = 0; - oprot_->writeMessageBegin("get_all_tables", ::apache::thrift::protocol::T_CALL, cseqid); + oprot_->writeMessageBegin("append_partition", ::apache::thrift::protocol::T_CALL, cseqid); - ThriftHiveMetastore_get_all_tables_pargs args; + ThriftHiveMetastore_append_partition_pargs args; args.db_name = &db_name; + args.tbl_name = &tbl_name; + args.part_vals = &part_vals; args.write(oprot_); oprot_->writeMessageEnd(); @@ -12993,7 +13963,7 @@ void ThriftHiveMetastoreClient::send_get_all_tables(const std::string& db_name) oprot_->getTransport()->writeEnd(); } -void ThriftHiveMetastoreClient::recv_get_all_tables(std::vector & _return) +void ThriftHiveMetastoreClient::recv_append_partition(Partition& _return) { int32_t rseqid = 0; @@ -13014,13 +13984,13 @@ void ThriftHiveMetastoreClient::recv_get_all_tables(std::vector & _ iprot_->getTransport()->readEnd(); throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::INVALID_MESSAGE_TYPE); } - if (fname.compare("get_all_tables") != 0) { + if (fname.compare("append_partition") != 0) { iprot_->skip(::apache::thrift::protocol::T_STRUCT); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::WRONG_METHOD_NAME); } - ThriftHiveMetastore_get_all_tables_presult result; + ThriftHiveMetastore_append_partition_presult result; result.success = &_return; result.read(iprot_); iprot_->readMessageEnd(); @@ -13033,23 +14003,30 @@ void ThriftHiveMetastoreClient::recv_get_all_tables(std::vector & _ if (result.__isset.o1) { throw result.o1; } - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_all_tables failed: unknown result"); + if (result.__isset.o2) { + throw result.o2; + } + if (result.__isset.o3) { + throw result.o3; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "append_partition failed: unknown result"); } -void ThriftHiveMetastoreClient::get_table(Table& _return, const std::string& dbname, const std::string& tbl_name) +void ThriftHiveMetastoreClient::append_partition_by_name(Partition& _return, const std::string& db_name, const std::string& tbl_name, const std::string& part_name) { - send_get_table(dbname, tbl_name); - recv_get_table(_return); + send_append_partition_by_name(db_name, tbl_name, part_name); + recv_append_partition_by_name(_return); } -void ThriftHiveMetastoreClient::send_get_table(const std::string& dbname, const std::string& tbl_name) +void ThriftHiveMetastoreClient::send_append_partition_by_name(const std::string& db_name, const std::string& tbl_name, const std::string& part_name) { int32_t cseqid = 0; - oprot_->writeMessageBegin("get_table", ::apache::thrift::protocol::T_CALL, cseqid); + oprot_->writeMessageBegin("append_partition_by_name", ::apache::thrift::protocol::T_CALL, cseqid); - ThriftHiveMetastore_get_table_pargs args; - args.dbname = &dbname; + ThriftHiveMetastore_append_partition_by_name_pargs args; + args.db_name = &db_name; args.tbl_name = &tbl_name; + args.part_name = &part_name; args.write(oprot_); oprot_->writeMessageEnd(); @@ -13057,7 +14034,7 @@ void ThriftHiveMetastoreClient::send_get_table(const std::string& dbname, const oprot_->getTransport()->writeEnd(); } -void ThriftHiveMetastoreClient::recv_get_table(Table& _return) +void ThriftHiveMetastoreClient::recv_append_partition_by_name(Partition& _return) { int32_t rseqid = 0; @@ -13078,13 +14055,13 @@ void ThriftHiveMetastoreClient::recv_get_table(Table& _return) iprot_->getTransport()->readEnd(); throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::INVALID_MESSAGE_TYPE); } - if (fname.compare("get_table") != 0) { + if (fname.compare("append_partition_by_name") != 0) { iprot_->skip(::apache::thrift::protocol::T_STRUCT); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::WRONG_METHOD_NAME); } - ThriftHiveMetastore_get_table_presult result; + ThriftHiveMetastore_append_partition_by_name_presult result; result.success = &_return; result.read(iprot_); iprot_->readMessageEnd(); @@ -13100,24 +14077,28 @@ void ThriftHiveMetastoreClient::recv_get_table(Table& _return) if (result.__isset.o2) { throw result.o2; } - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_table failed: unknown result"); + if (result.__isset.o3) { + throw result.o3; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "append_partition_by_name failed: unknown result"); } -void ThriftHiveMetastoreClient::alter_table(const std::string& dbname, const std::string& tbl_name, const Table& new_tbl) +bool ThriftHiveMetastoreClient::drop_partition(const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals, const bool deleteData) { - send_alter_table(dbname, tbl_name, new_tbl); - recv_alter_table(); + send_drop_partition(db_name, tbl_name, part_vals, deleteData); + return recv_drop_partition(); } -void ThriftHiveMetastoreClient::send_alter_table(const std::string& dbname, const std::string& tbl_name, const Table& new_tbl) +void ThriftHiveMetastoreClient::send_drop_partition(const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals, const bool deleteData) { int32_t cseqid = 0; - oprot_->writeMessageBegin("alter_table", ::apache::thrift::protocol::T_CALL, cseqid); + oprot_->writeMessageBegin("drop_partition", ::apache::thrift::protocol::T_CALL, cseqid); - ThriftHiveMetastore_alter_table_pargs args; - args.dbname = &dbname; + ThriftHiveMetastore_drop_partition_pargs args; + args.db_name = &db_name; args.tbl_name = &tbl_name; - args.new_tbl = &new_tbl; + args.part_vals = &part_vals; + args.deleteData = &deleteData; args.write(oprot_); oprot_->writeMessageEnd(); @@ -13125,7 +14106,7 @@ void ThriftHiveMetastoreClient::send_alter_table(const std::string& dbname, cons oprot_->getTransport()->writeEnd(); } -void ThriftHiveMetastoreClient::recv_alter_table() +bool ThriftHiveMetastoreClient::recv_drop_partition() { int32_t rseqid = 0; @@ -13146,39 +14127,47 @@ void ThriftHiveMetastoreClient::recv_alter_table() iprot_->getTransport()->readEnd(); throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::INVALID_MESSAGE_TYPE); } - if (fname.compare("alter_table") != 0) { + if (fname.compare("drop_partition") != 0) { iprot_->skip(::apache::thrift::protocol::T_STRUCT); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::WRONG_METHOD_NAME); } - ThriftHiveMetastore_alter_table_presult result; + bool _return; + ThriftHiveMetastore_drop_partition_presult result; + result.success = &_return; result.read(iprot_); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); + if (result.__isset.success) { + return _return; + } if (result.__isset.o1) { throw result.o1; } if (result.__isset.o2) { throw result.o2; } - return; + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "drop_partition failed: unknown result"); } -void ThriftHiveMetastoreClient::add_partition(Partition& _return, const Partition& new_part) +bool ThriftHiveMetastoreClient::drop_partition_by_name(const std::string& db_name, const std::string& tbl_name, const std::string& part_name, const bool deleteData) { - send_add_partition(new_part); - recv_add_partition(_return); + send_drop_partition_by_name(db_name, tbl_name, part_name, deleteData); + return recv_drop_partition_by_name(); } -void ThriftHiveMetastoreClient::send_add_partition(const Partition& new_part) +void ThriftHiveMetastoreClient::send_drop_partition_by_name(const std::string& db_name, const std::string& tbl_name, const std::string& part_name, const bool deleteData) { int32_t cseqid = 0; - oprot_->writeMessageBegin("add_partition", ::apache::thrift::protocol::T_CALL, cseqid); + oprot_->writeMessageBegin("drop_partition_by_name", ::apache::thrift::protocol::T_CALL, cseqid); - ThriftHiveMetastore_add_partition_pargs args; - args.new_part = &new_part; + ThriftHiveMetastore_drop_partition_by_name_pargs args; + args.db_name = &db_name; + args.tbl_name = &tbl_name; + args.part_name = &part_name; + args.deleteData = &deleteData; args.write(oprot_); oprot_->writeMessageEnd(); @@ -13186,7 +14175,7 @@ void ThriftHiveMetastoreClient::send_add_partition(const Partition& new_part) oprot_->getTransport()->writeEnd(); } -void ThriftHiveMetastoreClient::recv_add_partition(Partition& _return) +bool ThriftHiveMetastoreClient::recv_drop_partition_by_name() { int32_t rseqid = 0; @@ -13207,21 +14196,21 @@ void ThriftHiveMetastoreClient::recv_add_partition(Partition& _return) iprot_->getTransport()->readEnd(); throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::INVALID_MESSAGE_TYPE); } - if (fname.compare("add_partition") != 0) { + if (fname.compare("drop_partition_by_name") != 0) { iprot_->skip(::apache::thrift::protocol::T_STRUCT); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::WRONG_METHOD_NAME); } - ThriftHiveMetastore_add_partition_presult result; + bool _return; + ThriftHiveMetastore_drop_partition_by_name_presult result; result.success = &_return; result.read(iprot_); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); if (result.__isset.success) { - // _return pointer has now been filled - return; + return _return; } if (result.__isset.o1) { throw result.o1; @@ -13229,24 +14218,21 @@ void ThriftHiveMetastoreClient::recv_add_partition(Partition& _return) if (result.__isset.o2) { throw result.o2; } - if (result.__isset.o3) { - throw result.o3; - } - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "add_partition failed: unknown result"); + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "drop_partition_by_name failed: unknown result"); } -void ThriftHiveMetastoreClient::append_partition(Partition& _return, const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals) +void ThriftHiveMetastoreClient::get_partition(Partition& _return, const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals) { - send_append_partition(db_name, tbl_name, part_vals); - recv_append_partition(_return); + send_get_partition(db_name, tbl_name, part_vals); + recv_get_partition(_return); } -void ThriftHiveMetastoreClient::send_append_partition(const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals) +void ThriftHiveMetastoreClient::send_get_partition(const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals) { int32_t cseqid = 0; - oprot_->writeMessageBegin("append_partition", ::apache::thrift::protocol::T_CALL, cseqid); + oprot_->writeMessageBegin("get_partition", ::apache::thrift::protocol::T_CALL, cseqid); - ThriftHiveMetastore_append_partition_pargs args; + ThriftHiveMetastore_get_partition_pargs args; args.db_name = &db_name; args.tbl_name = &tbl_name; args.part_vals = &part_vals; @@ -13257,7 +14243,7 @@ void ThriftHiveMetastoreClient::send_append_partition(const std::string& db_name oprot_->getTransport()->writeEnd(); } -void ThriftHiveMetastoreClient::recv_append_partition(Partition& _return) +void ThriftHiveMetastoreClient::recv_get_partition(Partition& _return) { int32_t rseqid = 0; @@ -13278,13 +14264,13 @@ void ThriftHiveMetastoreClient::recv_append_partition(Partition& _return) iprot_->getTransport()->readEnd(); throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::INVALID_MESSAGE_TYPE); } - if (fname.compare("append_partition") != 0) { + if (fname.compare("get_partition") != 0) { iprot_->skip(::apache::thrift::protocol::T_STRUCT); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::WRONG_METHOD_NAME); } - ThriftHiveMetastore_append_partition_presult result; + ThriftHiveMetastore_get_partition_presult result; result.success = &_return; result.read(iprot_); iprot_->readMessageEnd(); @@ -13300,27 +14286,26 @@ void ThriftHiveMetastoreClient::recv_append_partition(Partition& _return) if (result.__isset.o2) { throw result.o2; } - if (result.__isset.o3) { - throw result.o3; - } - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "append_partition failed: unknown result"); + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_partition failed: unknown result"); } -void ThriftHiveMetastoreClient::append_partition_by_name(Partition& _return, const std::string& db_name, const std::string& tbl_name, const std::string& part_name) +void ThriftHiveMetastoreClient::get_partition_with_auth(Partition& _return, const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals, const std::string& user_name, const std::vector & group_names) { - send_append_partition_by_name(db_name, tbl_name, part_name); - recv_append_partition_by_name(_return); + send_get_partition_with_auth(db_name, tbl_name, part_vals, user_name, group_names); + recv_get_partition_with_auth(_return); } -void ThriftHiveMetastoreClient::send_append_partition_by_name(const std::string& db_name, const std::string& tbl_name, const std::string& part_name) +void ThriftHiveMetastoreClient::send_get_partition_with_auth(const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals, const std::string& user_name, const std::vector & group_names) { int32_t cseqid = 0; - oprot_->writeMessageBegin("append_partition_by_name", ::apache::thrift::protocol::T_CALL, cseqid); + oprot_->writeMessageBegin("get_partition_with_auth", ::apache::thrift::protocol::T_CALL, cseqid); - ThriftHiveMetastore_append_partition_by_name_pargs args; + ThriftHiveMetastore_get_partition_with_auth_pargs args; args.db_name = &db_name; args.tbl_name = &tbl_name; - args.part_name = &part_name; + args.part_vals = &part_vals; + args.user_name = &user_name; + args.group_names = &group_names; args.write(oprot_); oprot_->writeMessageEnd(); @@ -13328,7 +14313,7 @@ void ThriftHiveMetastoreClient::send_append_partition_by_name(const std::string& oprot_->getTransport()->writeEnd(); } -void ThriftHiveMetastoreClient::recv_append_partition_by_name(Partition& _return) +void ThriftHiveMetastoreClient::recv_get_partition_with_auth(Partition& _return) { int32_t rseqid = 0; @@ -13349,13 +14334,13 @@ void ThriftHiveMetastoreClient::recv_append_partition_by_name(Partition& _return iprot_->getTransport()->readEnd(); throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::INVALID_MESSAGE_TYPE); } - if (fname.compare("append_partition_by_name") != 0) { + if (fname.compare("get_partition_with_auth") != 0) { iprot_->skip(::apache::thrift::protocol::T_STRUCT); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::WRONG_METHOD_NAME); } - ThriftHiveMetastore_append_partition_by_name_presult result; + ThriftHiveMetastore_get_partition_with_auth_presult result; result.success = &_return; result.read(iprot_); iprot_->readMessageEnd(); @@ -13371,28 +14356,24 @@ void ThriftHiveMetastoreClient::recv_append_partition_by_name(Partition& _return if (result.__isset.o2) { throw result.o2; } - if (result.__isset.o3) { - throw result.o3; - } - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "append_partition_by_name failed: unknown result"); + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_partition_with_auth failed: unknown result"); } -bool ThriftHiveMetastoreClient::drop_partition(const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals, const bool deleteData) +void ThriftHiveMetastoreClient::get_partition_by_name(Partition& _return, const std::string& db_name, const std::string& tbl_name, const std::string& part_name) { - send_drop_partition(db_name, tbl_name, part_vals, deleteData); - return recv_drop_partition(); + send_get_partition_by_name(db_name, tbl_name, part_name); + recv_get_partition_by_name(_return); } -void ThriftHiveMetastoreClient::send_drop_partition(const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals, const bool deleteData) +void ThriftHiveMetastoreClient::send_get_partition_by_name(const std::string& db_name, const std::string& tbl_name, const std::string& part_name) { int32_t cseqid = 0; - oprot_->writeMessageBegin("drop_partition", ::apache::thrift::protocol::T_CALL, cseqid); + oprot_->writeMessageBegin("get_partition_by_name", ::apache::thrift::protocol::T_CALL, cseqid); - ThriftHiveMetastore_drop_partition_pargs args; + ThriftHiveMetastore_get_partition_by_name_pargs args; args.db_name = &db_name; args.tbl_name = &tbl_name; - args.part_vals = &part_vals; - args.deleteData = &deleteData; + args.part_name = &part_name; args.write(oprot_); oprot_->writeMessageEnd(); @@ -13400,7 +14381,7 @@ void ThriftHiveMetastoreClient::send_drop_partition(const std::string& db_name, oprot_->getTransport()->writeEnd(); } -bool ThriftHiveMetastoreClient::recv_drop_partition() +void ThriftHiveMetastoreClient::recv_get_partition_by_name(Partition& _return) { int32_t rseqid = 0; @@ -13421,21 +14402,21 @@ bool ThriftHiveMetastoreClient::recv_drop_partition() iprot_->getTransport()->readEnd(); throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::INVALID_MESSAGE_TYPE); } - if (fname.compare("drop_partition") != 0) { + if (fname.compare("get_partition_by_name") != 0) { iprot_->skip(::apache::thrift::protocol::T_STRUCT); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::WRONG_METHOD_NAME); } - bool _return; - ThriftHiveMetastore_drop_partition_presult result; + ThriftHiveMetastore_get_partition_by_name_presult result; result.success = &_return; result.read(iprot_); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); if (result.__isset.success) { - return _return; + // _return pointer has now been filled + return; } if (result.__isset.o1) { throw result.o1; @@ -13443,25 +14424,24 @@ bool ThriftHiveMetastoreClient::recv_drop_partition() if (result.__isset.o2) { throw result.o2; } - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "drop_partition failed: unknown result"); + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_partition_by_name failed: unknown result"); } -bool ThriftHiveMetastoreClient::drop_partition_by_name(const std::string& db_name, const std::string& tbl_name, const std::string& part_name, const bool deleteData) +void ThriftHiveMetastoreClient::get_partitions(std::vector & _return, const std::string& db_name, const std::string& tbl_name, const int16_t max_parts) { - send_drop_partition_by_name(db_name, tbl_name, part_name, deleteData); - return recv_drop_partition_by_name(); + send_get_partitions(db_name, tbl_name, max_parts); + recv_get_partitions(_return); } -void ThriftHiveMetastoreClient::send_drop_partition_by_name(const std::string& db_name, const std::string& tbl_name, const std::string& part_name, const bool deleteData) +void ThriftHiveMetastoreClient::send_get_partitions(const std::string& db_name, const std::string& tbl_name, const int16_t max_parts) { int32_t cseqid = 0; - oprot_->writeMessageBegin("drop_partition_by_name", ::apache::thrift::protocol::T_CALL, cseqid); + oprot_->writeMessageBegin("get_partitions", ::apache::thrift::protocol::T_CALL, cseqid); - ThriftHiveMetastore_drop_partition_by_name_pargs args; + ThriftHiveMetastore_get_partitions_pargs args; args.db_name = &db_name; args.tbl_name = &tbl_name; - args.part_name = &part_name; - args.deleteData = &deleteData; + args.max_parts = &max_parts; args.write(oprot_); oprot_->writeMessageEnd(); @@ -13469,7 +14449,7 @@ void ThriftHiveMetastoreClient::send_drop_partition_by_name(const std::string& d oprot_->getTransport()->writeEnd(); } -bool ThriftHiveMetastoreClient::recv_drop_partition_by_name() +void ThriftHiveMetastoreClient::recv_get_partitions(std::vector & _return) { int32_t rseqid = 0; @@ -13490,21 +14470,21 @@ bool ThriftHiveMetastoreClient::recv_drop_partition_by_name() iprot_->getTransport()->readEnd(); throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::INVALID_MESSAGE_TYPE); } - if (fname.compare("drop_partition_by_name") != 0) { + if (fname.compare("get_partitions") != 0) { iprot_->skip(::apache::thrift::protocol::T_STRUCT); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::WRONG_METHOD_NAME); } - bool _return; - ThriftHiveMetastore_drop_partition_by_name_presult result; + ThriftHiveMetastore_get_partitions_presult result; result.success = &_return; result.read(iprot_); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); if (result.__isset.success) { - return _return; + // _return pointer has now been filled + return; } if (result.__isset.o1) { throw result.o1; @@ -13512,24 +14492,26 @@ bool ThriftHiveMetastoreClient::recv_drop_partition_by_name() if (result.__isset.o2) { throw result.o2; } - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "drop_partition_by_name failed: unknown result"); + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_partitions failed: unknown result"); } -void ThriftHiveMetastoreClient::get_partition(Partition& _return, const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals) +void ThriftHiveMetastoreClient::get_partitions_with_auth(std::vector & _return, const std::string& db_name, const std::string& tbl_name, const int16_t max_parts, const std::string& user_name, const std::vector & group_names) { - send_get_partition(db_name, tbl_name, part_vals); - recv_get_partition(_return); + send_get_partitions_with_auth(db_name, tbl_name, max_parts, user_name, group_names); + recv_get_partitions_with_auth(_return); } -void ThriftHiveMetastoreClient::send_get_partition(const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals) +void ThriftHiveMetastoreClient::send_get_partitions_with_auth(const std::string& db_name, const std::string& tbl_name, const int16_t max_parts, const std::string& user_name, const std::vector & group_names) { int32_t cseqid = 0; - oprot_->writeMessageBegin("get_partition", ::apache::thrift::protocol::T_CALL, cseqid); + oprot_->writeMessageBegin("get_partitions_with_auth", ::apache::thrift::protocol::T_CALL, cseqid); - ThriftHiveMetastore_get_partition_pargs args; + ThriftHiveMetastore_get_partitions_with_auth_pargs args; args.db_name = &db_name; args.tbl_name = &tbl_name; - args.part_vals = &part_vals; + args.max_parts = &max_parts; + args.user_name = &user_name; + args.group_names = &group_names; args.write(oprot_); oprot_->writeMessageEnd(); @@ -13537,7 +14519,7 @@ void ThriftHiveMetastoreClient::send_get_partition(const std::string& db_name, c oprot_->getTransport()->writeEnd(); } -void ThriftHiveMetastoreClient::recv_get_partition(Partition& _return) +void ThriftHiveMetastoreClient::recv_get_partitions_with_auth(std::vector & _return) { int32_t rseqid = 0; @@ -13558,13 +14540,13 @@ void ThriftHiveMetastoreClient::recv_get_partition(Partition& _return) iprot_->getTransport()->readEnd(); throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::INVALID_MESSAGE_TYPE); } - if (fname.compare("get_partition") != 0) { + if (fname.compare("get_partitions_with_auth") != 0) { iprot_->skip(::apache::thrift::protocol::T_STRUCT); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::WRONG_METHOD_NAME); } - ThriftHiveMetastore_get_partition_presult result; + ThriftHiveMetastore_get_partitions_with_auth_presult result; result.success = &_return; result.read(iprot_); iprot_->readMessageEnd(); @@ -13580,26 +14562,24 @@ void ThriftHiveMetastoreClient::recv_get_partition(Partition& _return) if (result.__isset.o2) { throw result.o2; } - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_partition failed: unknown result"); + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_partitions_with_auth failed: unknown result"); } -void ThriftHiveMetastoreClient::get_partition_with_auth(Partition& _return, const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals, const std::string& user_name, const std::vector & group_names) +void ThriftHiveMetastoreClient::get_partition_names(std::vector & _return, const std::string& db_name, const std::string& tbl_name, const int16_t max_parts) { - send_get_partition_with_auth(db_name, tbl_name, part_vals, user_name, group_names); - recv_get_partition_with_auth(_return); + send_get_partition_names(db_name, tbl_name, max_parts); + recv_get_partition_names(_return); } -void ThriftHiveMetastoreClient::send_get_partition_with_auth(const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals, const std::string& user_name, const std::vector & group_names) +void ThriftHiveMetastoreClient::send_get_partition_names(const std::string& db_name, const std::string& tbl_name, const int16_t max_parts) { int32_t cseqid = 0; - oprot_->writeMessageBegin("get_partition_with_auth", ::apache::thrift::protocol::T_CALL, cseqid); + oprot_->writeMessageBegin("get_partition_names", ::apache::thrift::protocol::T_CALL, cseqid); - ThriftHiveMetastore_get_partition_with_auth_pargs args; + ThriftHiveMetastore_get_partition_names_pargs args; args.db_name = &db_name; args.tbl_name = &tbl_name; - args.part_vals = &part_vals; - args.user_name = &user_name; - args.group_names = &group_names; + args.max_parts = &max_parts; args.write(oprot_); oprot_->writeMessageEnd(); @@ -13607,7 +14587,7 @@ void ThriftHiveMetastoreClient::send_get_partition_with_auth(const std::string& oprot_->getTransport()->writeEnd(); } -void ThriftHiveMetastoreClient::recv_get_partition_with_auth(Partition& _return) +void ThriftHiveMetastoreClient::recv_get_partition_names(std::vector & _return) { int32_t rseqid = 0; @@ -13628,13 +14608,13 @@ void ThriftHiveMetastoreClient::recv_get_partition_with_auth(Partition& _return) iprot_->getTransport()->readEnd(); throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::INVALID_MESSAGE_TYPE); } - if (fname.compare("get_partition_with_auth") != 0) { + if (fname.compare("get_partition_names") != 0) { iprot_->skip(::apache::thrift::protocol::T_STRUCT); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::WRONG_METHOD_NAME); } - ThriftHiveMetastore_get_partition_with_auth_presult result; + ThriftHiveMetastore_get_partition_names_presult result; result.success = &_return; result.read(iprot_); iprot_->readMessageEnd(); @@ -13644,30 +14624,28 @@ void ThriftHiveMetastoreClient::recv_get_partition_with_auth(Partition& _return) // _return pointer has now been filled return; } - if (result.__isset.o1) { - throw result.o1; - } if (result.__isset.o2) { throw result.o2; } - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_partition_with_auth failed: unknown result"); + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_partition_names failed: unknown result"); } -void ThriftHiveMetastoreClient::get_partition_by_name(Partition& _return, const std::string& db_name, const std::string& tbl_name, const std::string& part_name) +void ThriftHiveMetastoreClient::get_partitions_ps(std::vector & _return, const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals, const int16_t max_parts) { - send_get_partition_by_name(db_name, tbl_name, part_name); - recv_get_partition_by_name(_return); + send_get_partitions_ps(db_name, tbl_name, part_vals, max_parts); + recv_get_partitions_ps(_return); } -void ThriftHiveMetastoreClient::send_get_partition_by_name(const std::string& db_name, const std::string& tbl_name, const std::string& part_name) +void ThriftHiveMetastoreClient::send_get_partitions_ps(const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals, const int16_t max_parts) { int32_t cseqid = 0; - oprot_->writeMessageBegin("get_partition_by_name", ::apache::thrift::protocol::T_CALL, cseqid); + oprot_->writeMessageBegin("get_partitions_ps", ::apache::thrift::protocol::T_CALL, cseqid); - ThriftHiveMetastore_get_partition_by_name_pargs args; + ThriftHiveMetastore_get_partitions_ps_pargs args; args.db_name = &db_name; args.tbl_name = &tbl_name; - args.part_name = &part_name; + args.part_vals = &part_vals; + args.max_parts = &max_parts; args.write(oprot_); oprot_->writeMessageEnd(); @@ -13675,7 +14653,7 @@ void ThriftHiveMetastoreClient::send_get_partition_by_name(const std::string& db oprot_->getTransport()->writeEnd(); } -void ThriftHiveMetastoreClient::recv_get_partition_by_name(Partition& _return) +void ThriftHiveMetastoreClient::recv_get_partitions_ps(std::vector & _return) { int32_t rseqid = 0; @@ -13696,13 +14674,13 @@ void ThriftHiveMetastoreClient::recv_get_partition_by_name(Partition& _return) iprot_->getTransport()->readEnd(); throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::INVALID_MESSAGE_TYPE); } - if (fname.compare("get_partition_by_name") != 0) { + if (fname.compare("get_partitions_ps") != 0) { iprot_->skip(::apache::thrift::protocol::T_STRUCT); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::WRONG_METHOD_NAME); } - ThriftHiveMetastore_get_partition_by_name_presult result; + ThriftHiveMetastore_get_partitions_ps_presult result; result.success = &_return; result.read(iprot_); iprot_->readMessageEnd(); @@ -13715,27 +14693,27 @@ void ThriftHiveMetastoreClient::recv_get_partition_by_name(Partition& _return) if (result.__isset.o1) { throw result.o1; } - if (result.__isset.o2) { - throw result.o2; - } - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_partition_by_name failed: unknown result"); + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_partitions_ps failed: unknown result"); } -void ThriftHiveMetastoreClient::get_partitions(std::vector & _return, const std::string& db_name, const std::string& tbl_name, const int16_t max_parts) +void ThriftHiveMetastoreClient::get_partitions_ps_with_auth(std::vector & _return, const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals, const int16_t max_parts, const std::string& user_name, const std::vector & group_names) { - send_get_partitions(db_name, tbl_name, max_parts); - recv_get_partitions(_return); + send_get_partitions_ps_with_auth(db_name, tbl_name, part_vals, max_parts, user_name, group_names); + recv_get_partitions_ps_with_auth(_return); } -void ThriftHiveMetastoreClient::send_get_partitions(const std::string& db_name, const std::string& tbl_name, const int16_t max_parts) +void ThriftHiveMetastoreClient::send_get_partitions_ps_with_auth(const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals, const int16_t max_parts, const std::string& user_name, const std::vector & group_names) { int32_t cseqid = 0; - oprot_->writeMessageBegin("get_partitions", ::apache::thrift::protocol::T_CALL, cseqid); + oprot_->writeMessageBegin("get_partitions_ps_with_auth", ::apache::thrift::protocol::T_CALL, cseqid); - ThriftHiveMetastore_get_partitions_pargs args; + ThriftHiveMetastore_get_partitions_ps_with_auth_pargs args; args.db_name = &db_name; args.tbl_name = &tbl_name; + args.part_vals = &part_vals; args.max_parts = &max_parts; + args.user_name = &user_name; + args.group_names = &group_names; args.write(oprot_); oprot_->writeMessageEnd(); @@ -13743,7 +14721,7 @@ void ThriftHiveMetastoreClient::send_get_partitions(const std::string& db_name, oprot_->getTransport()->writeEnd(); } -void ThriftHiveMetastoreClient::recv_get_partitions(std::vector & _return) +void ThriftHiveMetastoreClient::recv_get_partitions_ps_with_auth(std::vector & _return) { int32_t rseqid = 0; @@ -13764,13 +14742,13 @@ void ThriftHiveMetastoreClient::recv_get_partitions(std::vector & _re iprot_->getTransport()->readEnd(); throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::INVALID_MESSAGE_TYPE); } - if (fname.compare("get_partitions") != 0) { + if (fname.compare("get_partitions_ps_with_auth") != 0) { iprot_->skip(::apache::thrift::protocol::T_STRUCT); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::WRONG_METHOD_NAME); } - ThriftHiveMetastore_get_partitions_presult result; + ThriftHiveMetastore_get_partitions_ps_with_auth_presult result; result.success = &_return; result.read(iprot_); iprot_->readMessageEnd(); @@ -13786,26 +14764,25 @@ void ThriftHiveMetastoreClient::recv_get_partitions(std::vector & _re if (result.__isset.o2) { throw result.o2; } - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_partitions failed: unknown result"); + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_partitions_ps_with_auth failed: unknown result"); } -void ThriftHiveMetastoreClient::get_partitions_with_auth(std::vector & _return, const std::string& db_name, const std::string& tbl_name, const int16_t max_parts, const std::string& user_name, const std::vector & group_names) +void ThriftHiveMetastoreClient::get_partition_names_ps(std::vector & _return, const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals, const int16_t max_parts) { - send_get_partitions_with_auth(db_name, tbl_name, max_parts, user_name, group_names); - recv_get_partitions_with_auth(_return); + send_get_partition_names_ps(db_name, tbl_name, part_vals, max_parts); + recv_get_partition_names_ps(_return); } -void ThriftHiveMetastoreClient::send_get_partitions_with_auth(const std::string& db_name, const std::string& tbl_name, const int16_t max_parts, const std::string& user_name, const std::vector & group_names) +void ThriftHiveMetastoreClient::send_get_partition_names_ps(const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals, const int16_t max_parts) { int32_t cseqid = 0; - oprot_->writeMessageBegin("get_partitions_with_auth", ::apache::thrift::protocol::T_CALL, cseqid); + oprot_->writeMessageBegin("get_partition_names_ps", ::apache::thrift::protocol::T_CALL, cseqid); - ThriftHiveMetastore_get_partitions_with_auth_pargs args; + ThriftHiveMetastore_get_partition_names_ps_pargs args; args.db_name = &db_name; args.tbl_name = &tbl_name; + args.part_vals = &part_vals; args.max_parts = &max_parts; - args.user_name = &user_name; - args.group_names = &group_names; args.write(oprot_); oprot_->writeMessageEnd(); @@ -13813,7 +14790,7 @@ void ThriftHiveMetastoreClient::send_get_partitions_with_auth(const std::string& oprot_->getTransport()->writeEnd(); } -void ThriftHiveMetastoreClient::recv_get_partitions_with_auth(std::vector & _return) +void ThriftHiveMetastoreClient::recv_get_partition_names_ps(std::vector & _return) { int32_t rseqid = 0; @@ -13834,13 +14811,13 @@ void ThriftHiveMetastoreClient::recv_get_partitions_with_auth(std::vectorgetTransport()->readEnd(); throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::INVALID_MESSAGE_TYPE); } - if (fname.compare("get_partitions_with_auth") != 0) { + if (fname.compare("get_partition_names_ps") != 0) { iprot_->skip(::apache::thrift::protocol::T_STRUCT); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::WRONG_METHOD_NAME); } - ThriftHiveMetastore_get_partitions_with_auth_presult result; + ThriftHiveMetastore_get_partition_names_ps_presult result; result.success = &_return; result.read(iprot_); iprot_->readMessageEnd(); @@ -13853,26 +14830,24 @@ void ThriftHiveMetastoreClient::recv_get_partitions_with_auth(std::vector & _return, const std::string& db_name, const std::string& tbl_name, const int16_t max_parts) +void ThriftHiveMetastoreClient::get_partitions_by_filter(std::vector & _return, const std::string& db_name, const std::string& tbl_name, const std::string& filter, const int16_t max_parts) { - send_get_partition_names(db_name, tbl_name, max_parts); - recv_get_partition_names(_return); + send_get_partitions_by_filter(db_name, tbl_name, filter, max_parts); + recv_get_partitions_by_filter(_return); } -void ThriftHiveMetastoreClient::send_get_partition_names(const std::string& db_name, const std::string& tbl_name, const int16_t max_parts) +void ThriftHiveMetastoreClient::send_get_partitions_by_filter(const std::string& db_name, const std::string& tbl_name, const std::string& filter, const int16_t max_parts) { int32_t cseqid = 0; - oprot_->writeMessageBegin("get_partition_names", ::apache::thrift::protocol::T_CALL, cseqid); + oprot_->writeMessageBegin("get_partitions_by_filter", ::apache::thrift::protocol::T_CALL, cseqid); - ThriftHiveMetastore_get_partition_names_pargs args; + ThriftHiveMetastore_get_partitions_by_filter_pargs args; args.db_name = &db_name; args.tbl_name = &tbl_name; + args.filter = &filter; args.max_parts = &max_parts; args.write(oprot_); @@ -13881,7 +14856,7 @@ void ThriftHiveMetastoreClient::send_get_partition_names(const std::string& db_n oprot_->getTransport()->writeEnd(); } -void ThriftHiveMetastoreClient::recv_get_partition_names(std::vector & _return) +void ThriftHiveMetastoreClient::recv_get_partitions_by_filter(std::vector & _return) { int32_t rseqid = 0; @@ -13902,13 +14877,13 @@ void ThriftHiveMetastoreClient::recv_get_partition_names(std::vectorgetTransport()->readEnd(); throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::INVALID_MESSAGE_TYPE); } - if (fname.compare("get_partition_names") != 0) { + if (fname.compare("get_partitions_by_filter") != 0) { iprot_->skip(::apache::thrift::protocol::T_STRUCT); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::WRONG_METHOD_NAME); } - ThriftHiveMetastore_get_partition_names_presult result; + ThriftHiveMetastore_get_partitions_by_filter_presult result; result.success = &_return; result.read(iprot_); iprot_->readMessageEnd(); @@ -13918,28 +14893,30 @@ void ThriftHiveMetastoreClient::recv_get_partition_names(std::vector & _return, const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals, const int16_t max_parts) +void ThriftHiveMetastoreClient::alter_partition(const std::string& db_name, const std::string& tbl_name, const Partition& new_part) { - send_get_partitions_ps(db_name, tbl_name, part_vals, max_parts); - recv_get_partitions_ps(_return); + send_alter_partition(db_name, tbl_name, new_part); + recv_alter_partition(); } -void ThriftHiveMetastoreClient::send_get_partitions_ps(const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals, const int16_t max_parts) +void ThriftHiveMetastoreClient::send_alter_partition(const std::string& db_name, const std::string& tbl_name, const Partition& new_part) { int32_t cseqid = 0; - oprot_->writeMessageBegin("get_partitions_ps", ::apache::thrift::protocol::T_CALL, cseqid); + oprot_->writeMessageBegin("alter_partition", ::apache::thrift::protocol::T_CALL, cseqid); - ThriftHiveMetastore_get_partitions_ps_pargs args; + ThriftHiveMetastore_alter_partition_pargs args; args.db_name = &db_name; args.tbl_name = &tbl_name; - args.part_vals = &part_vals; - args.max_parts = &max_parts; + args.new_part = &new_part; args.write(oprot_); oprot_->writeMessageEnd(); @@ -13947,7 +14924,7 @@ void ThriftHiveMetastoreClient::send_get_partitions_ps(const std::string& db_nam oprot_->getTransport()->writeEnd(); } -void ThriftHiveMetastoreClient::recv_get_partitions_ps(std::vector & _return) +void ThriftHiveMetastoreClient::recv_alter_partition() { int32_t rseqid = 0; @@ -13968,46 +14945,40 @@ void ThriftHiveMetastoreClient::recv_get_partitions_ps(std::vector & iprot_->getTransport()->readEnd(); throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::INVALID_MESSAGE_TYPE); } - if (fname.compare("get_partitions_ps") != 0) { + if (fname.compare("alter_partition") != 0) { iprot_->skip(::apache::thrift::protocol::T_STRUCT); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::WRONG_METHOD_NAME); } - ThriftHiveMetastore_get_partitions_ps_presult result; - result.success = &_return; + ThriftHiveMetastore_alter_partition_presult result; result.read(iprot_); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); - if (result.__isset.success) { - // _return pointer has now been filled - return; - } if (result.__isset.o1) { throw result.o1; } - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_partitions_ps failed: unknown result"); + if (result.__isset.o2) { + throw result.o2; + } + return; } -void ThriftHiveMetastoreClient::get_partitions_ps_with_auth(std::vector & _return, const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals, const int16_t max_parts, const std::string& user_name, const std::vector & group_names) +void ThriftHiveMetastoreClient::get_config_value(std::string& _return, const std::string& name, const std::string& defaultValue) { - send_get_partitions_ps_with_auth(db_name, tbl_name, part_vals, max_parts, user_name, group_names); - recv_get_partitions_ps_with_auth(_return); + send_get_config_value(name, defaultValue); + recv_get_config_value(_return); } -void ThriftHiveMetastoreClient::send_get_partitions_ps_with_auth(const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals, const int16_t max_parts, const std::string& user_name, const std::vector & group_names) +void ThriftHiveMetastoreClient::send_get_config_value(const std::string& name, const std::string& defaultValue) { int32_t cseqid = 0; - oprot_->writeMessageBegin("get_partitions_ps_with_auth", ::apache::thrift::protocol::T_CALL, cseqid); + oprot_->writeMessageBegin("get_config_value", ::apache::thrift::protocol::T_CALL, cseqid); - ThriftHiveMetastore_get_partitions_ps_with_auth_pargs args; - args.db_name = &db_name; - args.tbl_name = &tbl_name; - args.part_vals = &part_vals; - args.max_parts = &max_parts; - args.user_name = &user_name; - args.group_names = &group_names; + ThriftHiveMetastore_get_config_value_pargs args; + args.name = &name; + args.defaultValue = &defaultValue; args.write(oprot_); oprot_->writeMessageEnd(); @@ -14015,7 +14986,7 @@ void ThriftHiveMetastoreClient::send_get_partitions_ps_with_auth(const std::stri oprot_->getTransport()->writeEnd(); } -void ThriftHiveMetastoreClient::recv_get_partitions_ps_with_auth(std::vector & _return) +void ThriftHiveMetastoreClient::recv_get_config_value(std::string& _return) { int32_t rseqid = 0; @@ -14036,13 +15007,13 @@ void ThriftHiveMetastoreClient::recv_get_partitions_ps_with_auth(std::vectorgetTransport()->readEnd(); throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::INVALID_MESSAGE_TYPE); } - if (fname.compare("get_partitions_ps_with_auth") != 0) { + if (fname.compare("get_config_value") != 0) { iprot_->skip(::apache::thrift::protocol::T_STRUCT); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::WRONG_METHOD_NAME); } - ThriftHiveMetastore_get_partitions_ps_with_auth_presult result; + ThriftHiveMetastore_get_config_value_presult result; result.success = &_return; result.read(iprot_); iprot_->readMessageEnd(); @@ -14055,28 +15026,22 @@ void ThriftHiveMetastoreClient::recv_get_partitions_ps_with_auth(std::vector & _return, const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals, const int16_t max_parts) +void ThriftHiveMetastoreClient::partition_name_to_vals(std::vector & _return, const std::string& part_name) { - send_get_partition_names_ps(db_name, tbl_name, part_vals, max_parts); - recv_get_partition_names_ps(_return); + send_partition_name_to_vals(part_name); + recv_partition_name_to_vals(_return); } -void ThriftHiveMetastoreClient::send_get_partition_names_ps(const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals, const int16_t max_parts) +void ThriftHiveMetastoreClient::send_partition_name_to_vals(const std::string& part_name) { int32_t cseqid = 0; - oprot_->writeMessageBegin("get_partition_names_ps", ::apache::thrift::protocol::T_CALL, cseqid); + oprot_->writeMessageBegin("partition_name_to_vals", ::apache::thrift::protocol::T_CALL, cseqid); - ThriftHiveMetastore_get_partition_names_ps_pargs args; - args.db_name = &db_name; - args.tbl_name = &tbl_name; - args.part_vals = &part_vals; - args.max_parts = &max_parts; + ThriftHiveMetastore_partition_name_to_vals_pargs args; + args.part_name = &part_name; args.write(oprot_); oprot_->writeMessageEnd(); @@ -14084,7 +15049,7 @@ void ThriftHiveMetastoreClient::send_get_partition_names_ps(const std::string& d oprot_->getTransport()->writeEnd(); } -void ThriftHiveMetastoreClient::recv_get_partition_names_ps(std::vector & _return) +void ThriftHiveMetastoreClient::recv_partition_name_to_vals(std::vector & _return) { int32_t rseqid = 0; @@ -14105,13 +15070,13 @@ void ThriftHiveMetastoreClient::recv_get_partition_names_ps(std::vectorgetTransport()->readEnd(); throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::INVALID_MESSAGE_TYPE); } - if (fname.compare("get_partition_names_ps") != 0) { + if (fname.compare("partition_name_to_vals") != 0) { iprot_->skip(::apache::thrift::protocol::T_STRUCT); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::WRONG_METHOD_NAME); } - ThriftHiveMetastore_get_partition_names_ps_presult result; + ThriftHiveMetastore_partition_name_to_vals_presult result; result.success = &_return; result.read(iprot_); iprot_->readMessageEnd(); @@ -14124,25 +15089,22 @@ void ThriftHiveMetastoreClient::recv_get_partition_names_ps(std::vector & _return, const std::string& db_name, const std::string& tbl_name, const std::string& filter, const int16_t max_parts) +void ThriftHiveMetastoreClient::partition_name_to_spec(std::map & _return, const std::string& part_name) { - send_get_partitions_by_filter(db_name, tbl_name, filter, max_parts); - recv_get_partitions_by_filter(_return); + send_partition_name_to_spec(part_name); + recv_partition_name_to_spec(_return); } -void ThriftHiveMetastoreClient::send_get_partitions_by_filter(const std::string& db_name, const std::string& tbl_name, const std::string& filter, const int16_t max_parts) +void ThriftHiveMetastoreClient::send_partition_name_to_spec(const std::string& part_name) { int32_t cseqid = 0; - oprot_->writeMessageBegin("get_partitions_by_filter", ::apache::thrift::protocol::T_CALL, cseqid); + oprot_->writeMessageBegin("partition_name_to_spec", ::apache::thrift::protocol::T_CALL, cseqid); - ThriftHiveMetastore_get_partitions_by_filter_pargs args; - args.db_name = &db_name; - args.tbl_name = &tbl_name; - args.filter = &filter; - args.max_parts = &max_parts; + ThriftHiveMetastore_partition_name_to_spec_pargs args; + args.part_name = &part_name; args.write(oprot_); oprot_->writeMessageEnd(); @@ -14150,7 +15112,7 @@ void ThriftHiveMetastoreClient::send_get_partitions_by_filter(const std::string& oprot_->getTransport()->writeEnd(); } -void ThriftHiveMetastoreClient::recv_get_partitions_by_filter(std::vector & _return) +void ThriftHiveMetastoreClient::recv_partition_name_to_spec(std::map & _return) { int32_t rseqid = 0; @@ -14171,13 +15133,13 @@ void ThriftHiveMetastoreClient::recv_get_partitions_by_filter(std::vectorgetTransport()->readEnd(); throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::INVALID_MESSAGE_TYPE); } - if (fname.compare("get_partitions_by_filter") != 0) { + if (fname.compare("partition_name_to_spec") != 0) { iprot_->skip(::apache::thrift::protocol::T_STRUCT); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::WRONG_METHOD_NAME); } - ThriftHiveMetastore_get_partitions_by_filter_presult result; + ThriftHiveMetastore_partition_name_to_spec_presult result; result.success = &_return; result.read(iprot_); iprot_->readMessageEnd(); @@ -14190,27 +15152,23 @@ void ThriftHiveMetastoreClient::recv_get_partitions_by_filter(std::vectorwriteMessageBegin("alter_partition", ::apache::thrift::protocol::T_CALL, cseqid); + oprot_->writeMessageBegin("add_index", ::apache::thrift::protocol::T_CALL, cseqid); - ThriftHiveMetastore_alter_partition_pargs args; - args.db_name = &db_name; - args.tbl_name = &tbl_name; - args.new_part = &new_part; + ThriftHiveMetastore_add_index_pargs args; + args.new_index = &new_index; + args.index_table = &index_table; args.write(oprot_); oprot_->writeMessageEnd(); @@ -14218,7 +15176,7 @@ void ThriftHiveMetastoreClient::send_alter_partition(const std::string& db_name, oprot_->getTransport()->writeEnd(); } -void ThriftHiveMetastoreClient::recv_alter_partition() +void ThriftHiveMetastoreClient::recv_add_index(Index& _return) { int32_t rseqid = 0; @@ -14239,40 +15197,50 @@ void ThriftHiveMetastoreClient::recv_alter_partition() iprot_->getTransport()->readEnd(); throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::INVALID_MESSAGE_TYPE); } - if (fname.compare("alter_partition") != 0) { + if (fname.compare("add_index") != 0) { iprot_->skip(::apache::thrift::protocol::T_STRUCT); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::WRONG_METHOD_NAME); } - ThriftHiveMetastore_alter_partition_presult result; + ThriftHiveMetastore_add_index_presult result; + result.success = &_return; result.read(iprot_); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); + if (result.__isset.success) { + // _return pointer has now been filled + return; + } if (result.__isset.o1) { throw result.o1; } if (result.__isset.o2) { throw result.o2; } - return; + if (result.__isset.o3) { + throw result.o3; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "add_index failed: unknown result"); } -void ThriftHiveMetastoreClient::get_config_value(std::string& _return, const std::string& name, const std::string& defaultValue) +void ThriftHiveMetastoreClient::alter_index(const std::string& dbname, const std::string& base_tbl_name, const std::string& idx_name, const Index& new_idx) { - send_get_config_value(name, defaultValue); - recv_get_config_value(_return); + send_alter_index(dbname, base_tbl_name, idx_name, new_idx); + recv_alter_index(); } -void ThriftHiveMetastoreClient::send_get_config_value(const std::string& name, const std::string& defaultValue) +void ThriftHiveMetastoreClient::send_alter_index(const std::string& dbname, const std::string& base_tbl_name, const std::string& idx_name, const Index& new_idx) { int32_t cseqid = 0; - oprot_->writeMessageBegin("get_config_value", ::apache::thrift::protocol::T_CALL, cseqid); + oprot_->writeMessageBegin("alter_index", ::apache::thrift::protocol::T_CALL, cseqid); - ThriftHiveMetastore_get_config_value_pargs args; - args.name = &name; - args.defaultValue = &defaultValue; + ThriftHiveMetastore_alter_index_pargs args; + args.dbname = &dbname; + args.base_tbl_name = &base_tbl_name; + args.idx_name = &idx_name; + args.new_idx = &new_idx; args.write(oprot_); oprot_->writeMessageEnd(); @@ -14280,7 +15248,7 @@ void ThriftHiveMetastoreClient::send_get_config_value(const std::string& name, c oprot_->getTransport()->writeEnd(); } -void ThriftHiveMetastoreClient::recv_get_config_value(std::string& _return) +void ThriftHiveMetastoreClient::recv_alter_index() { int32_t rseqid = 0; @@ -14301,41 +15269,42 @@ void ThriftHiveMetastoreClient::recv_get_config_value(std::string& _return) iprot_->getTransport()->readEnd(); throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::INVALID_MESSAGE_TYPE); } - if (fname.compare("get_config_value") != 0) { + if (fname.compare("alter_index") != 0) { iprot_->skip(::apache::thrift::protocol::T_STRUCT); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::WRONG_METHOD_NAME); } - ThriftHiveMetastore_get_config_value_presult result; - result.success = &_return; + ThriftHiveMetastore_alter_index_presult result; result.read(iprot_); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); - if (result.__isset.success) { - // _return pointer has now been filled - return; - } if (result.__isset.o1) { throw result.o1; } - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_config_value failed: unknown result"); + if (result.__isset.o2) { + throw result.o2; + } + return; } -void ThriftHiveMetastoreClient::partition_name_to_vals(std::vector & _return, const std::string& part_name) +bool ThriftHiveMetastoreClient::drop_index_by_name(const std::string& db_name, const std::string& tbl_name, const std::string& index_name, const bool deleteData) { - send_partition_name_to_vals(part_name); - recv_partition_name_to_vals(_return); + send_drop_index_by_name(db_name, tbl_name, index_name, deleteData); + return recv_drop_index_by_name(); } -void ThriftHiveMetastoreClient::send_partition_name_to_vals(const std::string& part_name) +void ThriftHiveMetastoreClient::send_drop_index_by_name(const std::string& db_name, const std::string& tbl_name, const std::string& index_name, const bool deleteData) { int32_t cseqid = 0; - oprot_->writeMessageBegin("partition_name_to_vals", ::apache::thrift::protocol::T_CALL, cseqid); + oprot_->writeMessageBegin("drop_index_by_name", ::apache::thrift::protocol::T_CALL, cseqid); - ThriftHiveMetastore_partition_name_to_vals_pargs args; - args.part_name = &part_name; + ThriftHiveMetastore_drop_index_by_name_pargs args; + args.db_name = &db_name; + args.tbl_name = &tbl_name; + args.index_name = &index_name; + args.deleteData = &deleteData; args.write(oprot_); oprot_->writeMessageEnd(); @@ -14343,7 +15312,7 @@ void ThriftHiveMetastoreClient::send_partition_name_to_vals(const std::string& p oprot_->getTransport()->writeEnd(); } -void ThriftHiveMetastoreClient::recv_partition_name_to_vals(std::vector & _return) +bool ThriftHiveMetastoreClient::recv_drop_index_by_name() { int32_t rseqid = 0; @@ -14364,41 +15333,46 @@ void ThriftHiveMetastoreClient::recv_partition_name_to_vals(std::vectorgetTransport()->readEnd(); throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::INVALID_MESSAGE_TYPE); } - if (fname.compare("partition_name_to_vals") != 0) { + if (fname.compare("drop_index_by_name") != 0) { iprot_->skip(::apache::thrift::protocol::T_STRUCT); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::WRONG_METHOD_NAME); } - ThriftHiveMetastore_partition_name_to_vals_presult result; + bool _return; + ThriftHiveMetastore_drop_index_by_name_presult result; result.success = &_return; result.read(iprot_); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); if (result.__isset.success) { - // _return pointer has now been filled - return; + return _return; } if (result.__isset.o1) { throw result.o1; } - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "partition_name_to_vals failed: unknown result"); + if (result.__isset.o2) { + throw result.o2; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "drop_index_by_name failed: unknown result"); } -void ThriftHiveMetastoreClient::partition_name_to_spec(std::map & _return, const std::string& part_name) +void ThriftHiveMetastoreClient::get_index_by_name(Index& _return, const std::string& db_name, const std::string& tbl_name, const std::string& index_name) { - send_partition_name_to_spec(part_name); - recv_partition_name_to_spec(_return); + send_get_index_by_name(db_name, tbl_name, index_name); + recv_get_index_by_name(_return); } -void ThriftHiveMetastoreClient::send_partition_name_to_spec(const std::string& part_name) +void ThriftHiveMetastoreClient::send_get_index_by_name(const std::string& db_name, const std::string& tbl_name, const std::string& index_name) { int32_t cseqid = 0; - oprot_->writeMessageBegin("partition_name_to_spec", ::apache::thrift::protocol::T_CALL, cseqid); + oprot_->writeMessageBegin("get_index_by_name", ::apache::thrift::protocol::T_CALL, cseqid); - ThriftHiveMetastore_partition_name_to_spec_pargs args; - args.part_name = &part_name; + ThriftHiveMetastore_get_index_by_name_pargs args; + args.db_name = &db_name; + args.tbl_name = &tbl_name; + args.index_name = &index_name; args.write(oprot_); oprot_->writeMessageEnd(); @@ -14406,7 +15380,7 @@ void ThriftHiveMetastoreClient::send_partition_name_to_spec(const std::string& p oprot_->getTransport()->writeEnd(); } -void ThriftHiveMetastoreClient::recv_partition_name_to_spec(std::map & _return) +void ThriftHiveMetastoreClient::recv_get_index_by_name(Index& _return) { int32_t rseqid = 0; @@ -14427,13 +15401,13 @@ void ThriftHiveMetastoreClient::recv_partition_name_to_spec(std::mapgetTransport()->readEnd(); throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::INVALID_MESSAGE_TYPE); } - if (fname.compare("partition_name_to_spec") != 0) { + if (fname.compare("get_index_by_name") != 0) { iprot_->skip(::apache::thrift::protocol::T_STRUCT); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::WRONG_METHOD_NAME); } - ThriftHiveMetastore_partition_name_to_spec_presult result; + ThriftHiveMetastore_get_index_by_name_presult result; result.success = &_return; result.read(iprot_); iprot_->readMessageEnd(); @@ -14446,23 +15420,27 @@ void ThriftHiveMetastoreClient::recv_partition_name_to_spec(std::map & _return, const std::string& db_name, const std::string& tbl_name, const int16_t max_indexes) { - send_add_index(new_index, index_table); - recv_add_index(_return); + send_get_indexes(db_name, tbl_name, max_indexes); + recv_get_indexes(_return); } -void ThriftHiveMetastoreClient::send_add_index(const Index& new_index, const Table& index_table) +void ThriftHiveMetastoreClient::send_get_indexes(const std::string& db_name, const std::string& tbl_name, const int16_t max_indexes) { int32_t cseqid = 0; - oprot_->writeMessageBegin("add_index", ::apache::thrift::protocol::T_CALL, cseqid); + oprot_->writeMessageBegin("get_indexes", ::apache::thrift::protocol::T_CALL, cseqid); - ThriftHiveMetastore_add_index_pargs args; - args.new_index = &new_index; - args.index_table = &index_table; + ThriftHiveMetastore_get_indexes_pargs args; + args.db_name = &db_name; + args.tbl_name = &tbl_name; + args.max_indexes = &max_indexes; args.write(oprot_); oprot_->writeMessageEnd(); @@ -14470,7 +15448,7 @@ void ThriftHiveMetastoreClient::send_add_index(const Index& new_index, const Tab oprot_->getTransport()->writeEnd(); } -void ThriftHiveMetastoreClient::recv_add_index(Index& _return) +void ThriftHiveMetastoreClient::recv_get_indexes(std::vector & _return) { int32_t rseqid = 0; @@ -14491,13 +15469,13 @@ void ThriftHiveMetastoreClient::recv_add_index(Index& _return) iprot_->getTransport()->readEnd(); throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::INVALID_MESSAGE_TYPE); } - if (fname.compare("add_index") != 0) { + if (fname.compare("get_indexes") != 0) { iprot_->skip(::apache::thrift::protocol::T_STRUCT); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::WRONG_METHOD_NAME); } - ThriftHiveMetastore_add_index_presult result; + ThriftHiveMetastore_get_indexes_presult result; result.success = &_return; result.read(iprot_); iprot_->readMessageEnd(); @@ -14513,28 +15491,24 @@ void ThriftHiveMetastoreClient::recv_add_index(Index& _return) if (result.__isset.o2) { throw result.o2; } - if (result.__isset.o3) { - throw result.o3; - } - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "add_index failed: unknown result"); + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_indexes failed: unknown result"); } -void ThriftHiveMetastoreClient::alter_index(const std::string& dbname, const std::string& base_tbl_name, const std::string& idx_name, const Index& new_idx) +void ThriftHiveMetastoreClient::get_index_names(std::vector & _return, const std::string& db_name, const std::string& tbl_name, const int16_t max_indexes) { - send_alter_index(dbname, base_tbl_name, idx_name, new_idx); - recv_alter_index(); + send_get_index_names(db_name, tbl_name, max_indexes); + recv_get_index_names(_return); } -void ThriftHiveMetastoreClient::send_alter_index(const std::string& dbname, const std::string& base_tbl_name, const std::string& idx_name, const Index& new_idx) +void ThriftHiveMetastoreClient::send_get_index_names(const std::string& db_name, const std::string& tbl_name, const int16_t max_indexes) { int32_t cseqid = 0; - oprot_->writeMessageBegin("alter_index", ::apache::thrift::protocol::T_CALL, cseqid); + oprot_->writeMessageBegin("get_index_names", ::apache::thrift::protocol::T_CALL, cseqid); - ThriftHiveMetastore_alter_index_pargs args; - args.dbname = &dbname; - args.base_tbl_name = &base_tbl_name; - args.idx_name = &idx_name; - args.new_idx = &new_idx; + ThriftHiveMetastore_get_index_names_pargs args; + args.db_name = &db_name; + args.tbl_name = &tbl_name; + args.max_indexes = &max_indexes; args.write(oprot_); oprot_->writeMessageEnd(); @@ -14542,7 +15516,7 @@ void ThriftHiveMetastoreClient::send_alter_index(const std::string& dbname, cons oprot_->getTransport()->writeEnd(); } -void ThriftHiveMetastoreClient::recv_alter_index() +void ThriftHiveMetastoreClient::recv_get_index_names(std::vector & _return) { int32_t rseqid = 0; @@ -14563,42 +15537,41 @@ void ThriftHiveMetastoreClient::recv_alter_index() iprot_->getTransport()->readEnd(); throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::INVALID_MESSAGE_TYPE); } - if (fname.compare("alter_index") != 0) { + if (fname.compare("get_index_names") != 0) { iprot_->skip(::apache::thrift::protocol::T_STRUCT); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::WRONG_METHOD_NAME); } - ThriftHiveMetastore_alter_index_presult result; + ThriftHiveMetastore_get_index_names_presult result; + result.success = &_return; result.read(iprot_); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); - if (result.__isset.o1) { - throw result.o1; + if (result.__isset.success) { + // _return pointer has now been filled + return; } if (result.__isset.o2) { throw result.o2; } - return; + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_index_names failed: unknown result"); } -bool ThriftHiveMetastoreClient::drop_index_by_name(const std::string& db_name, const std::string& tbl_name, const std::string& index_name, const bool deleteData) +bool ThriftHiveMetastoreClient::create_role(const Role& role) { - send_drop_index_by_name(db_name, tbl_name, index_name, deleteData); - return recv_drop_index_by_name(); + send_create_role(role); + return recv_create_role(); } -void ThriftHiveMetastoreClient::send_drop_index_by_name(const std::string& db_name, const std::string& tbl_name, const std::string& index_name, const bool deleteData) +void ThriftHiveMetastoreClient::send_create_role(const Role& role) { int32_t cseqid = 0; - oprot_->writeMessageBegin("drop_index_by_name", ::apache::thrift::protocol::T_CALL, cseqid); + oprot_->writeMessageBegin("create_role", ::apache::thrift::protocol::T_CALL, cseqid); - ThriftHiveMetastore_drop_index_by_name_pargs args; - args.db_name = &db_name; - args.tbl_name = &tbl_name; - args.index_name = &index_name; - args.deleteData = &deleteData; + ThriftHiveMetastore_create_role_pargs args; + args.role = &role; args.write(oprot_); oprot_->writeMessageEnd(); @@ -14606,7 +15579,7 @@ void ThriftHiveMetastoreClient::send_drop_index_by_name(const std::string& db_na oprot_->getTransport()->writeEnd(); } -bool ThriftHiveMetastoreClient::recv_drop_index_by_name() +bool ThriftHiveMetastoreClient::recv_create_role() { int32_t rseqid = 0; @@ -14627,14 +15600,14 @@ bool ThriftHiveMetastoreClient::recv_drop_index_by_name() iprot_->getTransport()->readEnd(); throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::INVALID_MESSAGE_TYPE); } - if (fname.compare("drop_index_by_name") != 0) { + if (fname.compare("create_role") != 0) { iprot_->skip(::apache::thrift::protocol::T_STRUCT); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::WRONG_METHOD_NAME); } bool _return; - ThriftHiveMetastore_drop_index_by_name_presult result; + ThriftHiveMetastore_create_role_presult result; result.success = &_return; result.read(iprot_); iprot_->readMessageEnd(); @@ -14646,27 +15619,22 @@ bool ThriftHiveMetastoreClient::recv_drop_index_by_name() if (result.__isset.o1) { throw result.o1; } - if (result.__isset.o2) { - throw result.o2; - } - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "drop_index_by_name failed: unknown result"); + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "create_role failed: unknown result"); } -void ThriftHiveMetastoreClient::get_index_by_name(Index& _return, const std::string& db_name, const std::string& tbl_name, const std::string& index_name) +bool ThriftHiveMetastoreClient::drop_role(const std::string& role_name) { - send_get_index_by_name(db_name, tbl_name, index_name); - recv_get_index_by_name(_return); + send_drop_role(role_name); + return recv_drop_role(); } -void ThriftHiveMetastoreClient::send_get_index_by_name(const std::string& db_name, const std::string& tbl_name, const std::string& index_name) +void ThriftHiveMetastoreClient::send_drop_role(const std::string& role_name) { int32_t cseqid = 0; - oprot_->writeMessageBegin("get_index_by_name", ::apache::thrift::protocol::T_CALL, cseqid); + oprot_->writeMessageBegin("drop_role", ::apache::thrift::protocol::T_CALL, cseqid); - ThriftHiveMetastore_get_index_by_name_pargs args; - args.db_name = &db_name; - args.tbl_name = &tbl_name; - args.index_name = &index_name; + ThriftHiveMetastore_drop_role_pargs args; + args.role_name = &role_name; args.write(oprot_); oprot_->writeMessageEnd(); @@ -14674,7 +15642,7 @@ void ThriftHiveMetastoreClient::send_get_index_by_name(const std::string& db_nam oprot_->getTransport()->writeEnd(); } -void ThriftHiveMetastoreClient::recv_get_index_by_name(Index& _return) +bool ThriftHiveMetastoreClient::recv_drop_role() { int32_t rseqid = 0; @@ -14695,46 +15663,46 @@ void ThriftHiveMetastoreClient::recv_get_index_by_name(Index& _return) iprot_->getTransport()->readEnd(); throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::INVALID_MESSAGE_TYPE); } - if (fname.compare("get_index_by_name") != 0) { + if (fname.compare("drop_role") != 0) { iprot_->skip(::apache::thrift::protocol::T_STRUCT); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::WRONG_METHOD_NAME); } - ThriftHiveMetastore_get_index_by_name_presult result; + bool _return; + ThriftHiveMetastore_drop_role_presult result; result.success = &_return; result.read(iprot_); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); if (result.__isset.success) { - // _return pointer has now been filled - return; + return _return; } if (result.__isset.o1) { throw result.o1; } - if (result.__isset.o2) { - throw result.o2; - } - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_index_by_name failed: unknown result"); + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "drop_role failed: unknown result"); } -void ThriftHiveMetastoreClient::get_indexes(std::vector & _return, const std::string& db_name, const std::string& tbl_name, const int16_t max_indexes) +bool ThriftHiveMetastoreClient::grant_role(const std::string& role_name, const std::string& principal_name, const PrincipalType::type principal_type, const std::string& grantor, const PrincipalType::type grantorType, const bool grant_option) { - send_get_indexes(db_name, tbl_name, max_indexes); - recv_get_indexes(_return); + send_grant_role(role_name, principal_name, principal_type, grantor, grantorType, grant_option); + return recv_grant_role(); } -void ThriftHiveMetastoreClient::send_get_indexes(const std::string& db_name, const std::string& tbl_name, const int16_t max_indexes) +void ThriftHiveMetastoreClient::send_grant_role(const std::string& role_name, const std::string& principal_name, const PrincipalType::type principal_type, const std::string& grantor, const PrincipalType::type grantorType, const bool grant_option) { int32_t cseqid = 0; - oprot_->writeMessageBegin("get_indexes", ::apache::thrift::protocol::T_CALL, cseqid); + oprot_->writeMessageBegin("grant_role", ::apache::thrift::protocol::T_CALL, cseqid); - ThriftHiveMetastore_get_indexes_pargs args; - args.db_name = &db_name; - args.tbl_name = &tbl_name; - args.max_indexes = &max_indexes; + ThriftHiveMetastore_grant_role_pargs args; + args.role_name = &role_name; + args.principal_name = &principal_name; + args.principal_type = &principal_type; + args.grantor = &grantor; + args.grantorType = &grantorType; + args.grant_option = &grant_option; args.write(oprot_); oprot_->writeMessageEnd(); @@ -14742,7 +15710,7 @@ void ThriftHiveMetastoreClient::send_get_indexes(const std::string& db_name, con oprot_->getTransport()->writeEnd(); } -void ThriftHiveMetastoreClient::recv_get_indexes(std::vector & _return) +bool ThriftHiveMetastoreClient::recv_grant_role() { int32_t rseqid = 0; @@ -14763,46 +15731,43 @@ void ThriftHiveMetastoreClient::recv_get_indexes(std::vector & _return) iprot_->getTransport()->readEnd(); throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::INVALID_MESSAGE_TYPE); } - if (fname.compare("get_indexes") != 0) { + if (fname.compare("grant_role") != 0) { iprot_->skip(::apache::thrift::protocol::T_STRUCT); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::WRONG_METHOD_NAME); } - ThriftHiveMetastore_get_indexes_presult result; + bool _return; + ThriftHiveMetastore_grant_role_presult result; result.success = &_return; result.read(iprot_); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); if (result.__isset.success) { - // _return pointer has now been filled - return; + return _return; } if (result.__isset.o1) { throw result.o1; } - if (result.__isset.o2) { - throw result.o2; - } - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_indexes failed: unknown result"); + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "grant_role failed: unknown result"); } -void ThriftHiveMetastoreClient::get_index_names(std::vector & _return, const std::string& db_name, const std::string& tbl_name, const int16_t max_indexes) +bool ThriftHiveMetastoreClient::revoke_role(const std::string& role_name, const std::string& principal_name, const PrincipalType::type principal_type) { - send_get_index_names(db_name, tbl_name, max_indexes); - recv_get_index_names(_return); + send_revoke_role(role_name, principal_name, principal_type); + return recv_revoke_role(); } -void ThriftHiveMetastoreClient::send_get_index_names(const std::string& db_name, const std::string& tbl_name, const int16_t max_indexes) +void ThriftHiveMetastoreClient::send_revoke_role(const std::string& role_name, const std::string& principal_name, const PrincipalType::type principal_type) { int32_t cseqid = 0; - oprot_->writeMessageBegin("get_index_names", ::apache::thrift::protocol::T_CALL, cseqid); + oprot_->writeMessageBegin("revoke_role", ::apache::thrift::protocol::T_CALL, cseqid); - ThriftHiveMetastore_get_index_names_pargs args; - args.db_name = &db_name; - args.tbl_name = &tbl_name; - args.max_indexes = &max_indexes; + ThriftHiveMetastore_revoke_role_pargs args; + args.role_name = &role_name; + args.principal_name = &principal_name; + args.principal_type = &principal_type; args.write(oprot_); oprot_->writeMessageEnd(); @@ -14810,7 +15775,7 @@ void ThriftHiveMetastoreClient::send_get_index_names(const std::string& db_name, oprot_->getTransport()->writeEnd(); } -void ThriftHiveMetastoreClient::recv_get_index_names(std::vector & _return) +bool ThriftHiveMetastoreClient::recv_revoke_role() { int32_t rseqid = 0; @@ -14831,41 +15796,42 @@ void ThriftHiveMetastoreClient::recv_get_index_names(std::vector & iprot_->getTransport()->readEnd(); throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::INVALID_MESSAGE_TYPE); } - if (fname.compare("get_index_names") != 0) { + if (fname.compare("revoke_role") != 0) { iprot_->skip(::apache::thrift::protocol::T_STRUCT); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::WRONG_METHOD_NAME); } - ThriftHiveMetastore_get_index_names_presult result; + bool _return; + ThriftHiveMetastore_revoke_role_presult result; result.success = &_return; result.read(iprot_); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); if (result.__isset.success) { - // _return pointer has now been filled - return; + return _return; } - if (result.__isset.o2) { - throw result.o2; + if (result.__isset.o1) { + throw result.o1; } - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_index_names failed: unknown result"); + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "revoke_role failed: unknown result"); } -bool ThriftHiveMetastoreClient::create_role(const Role& role) +void ThriftHiveMetastoreClient::list_roles(std::vector & _return, const std::string& principal_name, const PrincipalType::type principal_type) { - send_create_role(role); - return recv_create_role(); + send_list_roles(principal_name, principal_type); + recv_list_roles(_return); } -void ThriftHiveMetastoreClient::send_create_role(const Role& role) +void ThriftHiveMetastoreClient::send_list_roles(const std::string& principal_name, const PrincipalType::type principal_type) { int32_t cseqid = 0; - oprot_->writeMessageBegin("create_role", ::apache::thrift::protocol::T_CALL, cseqid); + oprot_->writeMessageBegin("list_roles", ::apache::thrift::protocol::T_CALL, cseqid); - ThriftHiveMetastore_create_role_pargs args; - args.role = &role; + ThriftHiveMetastore_list_roles_pargs args; + args.principal_name = &principal_name; + args.principal_type = &principal_type; args.write(oprot_); oprot_->writeMessageEnd(); @@ -14873,7 +15839,7 @@ void ThriftHiveMetastoreClient::send_create_role(const Role& role) oprot_->getTransport()->writeEnd(); } -bool ThriftHiveMetastoreClient::recv_create_role() +void ThriftHiveMetastoreClient::recv_list_roles(std::vector & _return) { int32_t rseqid = 0; @@ -14894,41 +15860,43 @@ bool ThriftHiveMetastoreClient::recv_create_role() iprot_->getTransport()->readEnd(); throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::INVALID_MESSAGE_TYPE); } - if (fname.compare("create_role") != 0) { + if (fname.compare("list_roles") != 0) { iprot_->skip(::apache::thrift::protocol::T_STRUCT); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::WRONG_METHOD_NAME); } - bool _return; - ThriftHiveMetastore_create_role_presult result; + ThriftHiveMetastore_list_roles_presult result; result.success = &_return; result.read(iprot_); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); if (result.__isset.success) { - return _return; + // _return pointer has now been filled + return; } if (result.__isset.o1) { throw result.o1; } - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "create_role failed: unknown result"); + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "list_roles failed: unknown result"); } -bool ThriftHiveMetastoreClient::drop_role(const std::string& role_name) +void ThriftHiveMetastoreClient::get_privilege_set(PrincipalPrivilegeSet& _return, const HiveObjectRef& hiveObject, const std::string& user_name, const std::vector & group_names) { - send_drop_role(role_name); - return recv_drop_role(); + send_get_privilege_set(hiveObject, user_name, group_names); + recv_get_privilege_set(_return); } -void ThriftHiveMetastoreClient::send_drop_role(const std::string& role_name) +void ThriftHiveMetastoreClient::send_get_privilege_set(const HiveObjectRef& hiveObject, const std::string& user_name, const std::vector & group_names) { int32_t cseqid = 0; - oprot_->writeMessageBegin("drop_role", ::apache::thrift::protocol::T_CALL, cseqid); + oprot_->writeMessageBegin("get_privilege_set", ::apache::thrift::protocol::T_CALL, cseqid); - ThriftHiveMetastore_drop_role_pargs args; - args.role_name = &role_name; + ThriftHiveMetastore_get_privilege_set_pargs args; + args.hiveObject = &hiveObject; + args.user_name = &user_name; + args.group_names = &group_names; args.write(oprot_); oprot_->writeMessageEnd(); @@ -14936,7 +15904,7 @@ void ThriftHiveMetastoreClient::send_drop_role(const std::string& role_name) oprot_->getTransport()->writeEnd(); } -bool ThriftHiveMetastoreClient::recv_drop_role() +void ThriftHiveMetastoreClient::recv_get_privilege_set(PrincipalPrivilegeSet& _return) { int32_t rseqid = 0; @@ -14957,46 +15925,43 @@ bool ThriftHiveMetastoreClient::recv_drop_role() iprot_->getTransport()->readEnd(); throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::INVALID_MESSAGE_TYPE); } - if (fname.compare("drop_role") != 0) { + if (fname.compare("get_privilege_set") != 0) { iprot_->skip(::apache::thrift::protocol::T_STRUCT); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::WRONG_METHOD_NAME); } - bool _return; - ThriftHiveMetastore_drop_role_presult result; + ThriftHiveMetastore_get_privilege_set_presult result; result.success = &_return; result.read(iprot_); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); if (result.__isset.success) { - return _return; + // _return pointer has now been filled + return; } if (result.__isset.o1) { throw result.o1; } - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "drop_role failed: unknown result"); + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_privilege_set failed: unknown result"); } -bool ThriftHiveMetastoreClient::grant_role(const std::string& role_name, const std::string& principal_name, const PrincipalType::type principal_type, const std::string& grantor, const PrincipalType::type grantorType, const bool grant_option) +void ThriftHiveMetastoreClient::list_privileges(std::vector & _return, const std::string& principal_name, const PrincipalType::type principal_type, const HiveObjectRef& hiveObject) { - send_grant_role(role_name, principal_name, principal_type, grantor, grantorType, grant_option); - return recv_grant_role(); + send_list_privileges(principal_name, principal_type, hiveObject); + recv_list_privileges(_return); } -void ThriftHiveMetastoreClient::send_grant_role(const std::string& role_name, const std::string& principal_name, const PrincipalType::type principal_type, const std::string& grantor, const PrincipalType::type grantorType, const bool grant_option) +void ThriftHiveMetastoreClient::send_list_privileges(const std::string& principal_name, const PrincipalType::type principal_type, const HiveObjectRef& hiveObject) { int32_t cseqid = 0; - oprot_->writeMessageBegin("grant_role", ::apache::thrift::protocol::T_CALL, cseqid); + oprot_->writeMessageBegin("list_privileges", ::apache::thrift::protocol::T_CALL, cseqid); - ThriftHiveMetastore_grant_role_pargs args; - args.role_name = &role_name; + ThriftHiveMetastore_list_privileges_pargs args; args.principal_name = &principal_name; args.principal_type = &principal_type; - args.grantor = &grantor; - args.grantorType = &grantorType; - args.grant_option = &grant_option; + args.hiveObject = &hiveObject; args.write(oprot_); oprot_->writeMessageEnd(); @@ -15004,7 +15969,7 @@ void ThriftHiveMetastoreClient::send_grant_role(const std::string& role_name, co oprot_->getTransport()->writeEnd(); } -bool ThriftHiveMetastoreClient::recv_grant_role() +void ThriftHiveMetastoreClient::recv_list_privileges(std::vector & _return) { int32_t rseqid = 0; @@ -15025,43 +15990,41 @@ bool ThriftHiveMetastoreClient::recv_grant_role() iprot_->getTransport()->readEnd(); throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::INVALID_MESSAGE_TYPE); } - if (fname.compare("grant_role") != 0) { + if (fname.compare("list_privileges") != 0) { iprot_->skip(::apache::thrift::protocol::T_STRUCT); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::WRONG_METHOD_NAME); } - bool _return; - ThriftHiveMetastore_grant_role_presult result; + ThriftHiveMetastore_list_privileges_presult result; result.success = &_return; result.read(iprot_); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); if (result.__isset.success) { - return _return; + // _return pointer has now been filled + return; } if (result.__isset.o1) { throw result.o1; } - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "grant_role failed: unknown result"); + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "list_privileges failed: unknown result"); } -bool ThriftHiveMetastoreClient::revoke_role(const std::string& role_name, const std::string& principal_name, const PrincipalType::type principal_type) +bool ThriftHiveMetastoreClient::grant_privileges(const PrivilegeBag& privileges) { - send_revoke_role(role_name, principal_name, principal_type); - return recv_revoke_role(); + send_grant_privileges(privileges); + return recv_grant_privileges(); } -void ThriftHiveMetastoreClient::send_revoke_role(const std::string& role_name, const std::string& principal_name, const PrincipalType::type principal_type) +void ThriftHiveMetastoreClient::send_grant_privileges(const PrivilegeBag& privileges) { int32_t cseqid = 0; - oprot_->writeMessageBegin("revoke_role", ::apache::thrift::protocol::T_CALL, cseqid); + oprot_->writeMessageBegin("grant_privileges", ::apache::thrift::protocol::T_CALL, cseqid); - ThriftHiveMetastore_revoke_role_pargs args; - args.role_name = &role_name; - args.principal_name = &principal_name; - args.principal_type = &principal_type; + ThriftHiveMetastore_grant_privileges_pargs args; + args.privileges = &privileges; args.write(oprot_); oprot_->writeMessageEnd(); @@ -15069,7 +16032,7 @@ void ThriftHiveMetastoreClient::send_revoke_role(const std::string& role_name, c oprot_->getTransport()->writeEnd(); } -bool ThriftHiveMetastoreClient::recv_revoke_role() +bool ThriftHiveMetastoreClient::recv_grant_privileges() { int32_t rseqid = 0; @@ -15090,14 +16053,14 @@ bool ThriftHiveMetastoreClient::recv_revoke_role() iprot_->getTransport()->readEnd(); throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::INVALID_MESSAGE_TYPE); } - if (fname.compare("revoke_role") != 0) { + if (fname.compare("grant_privileges") != 0) { iprot_->skip(::apache::thrift::protocol::T_STRUCT); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::WRONG_METHOD_NAME); } bool _return; - ThriftHiveMetastore_revoke_role_presult result; + ThriftHiveMetastore_grant_privileges_presult result; result.success = &_return; result.read(iprot_); iprot_->readMessageEnd(); @@ -15109,23 +16072,22 @@ bool ThriftHiveMetastoreClient::recv_revoke_role() if (result.__isset.o1) { throw result.o1; } - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "revoke_role failed: unknown result"); + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "grant_privileges failed: unknown result"); } -void ThriftHiveMetastoreClient::list_roles(std::vector & _return, const std::string& principal_name, const PrincipalType::type principal_type) +bool ThriftHiveMetastoreClient::revoke_privileges(const PrivilegeBag& privileges) { - send_list_roles(principal_name, principal_type); - recv_list_roles(_return); + send_revoke_privileges(privileges); + return recv_revoke_privileges(); } -void ThriftHiveMetastoreClient::send_list_roles(const std::string& principal_name, const PrincipalType::type principal_type) +void ThriftHiveMetastoreClient::send_revoke_privileges(const PrivilegeBag& privileges) { int32_t cseqid = 0; - oprot_->writeMessageBegin("list_roles", ::apache::thrift::protocol::T_CALL, cseqid); + oprot_->writeMessageBegin("revoke_privileges", ::apache::thrift::protocol::T_CALL, cseqid); - ThriftHiveMetastore_list_roles_pargs args; - args.principal_name = &principal_name; - args.principal_type = &principal_type; + ThriftHiveMetastore_revoke_privileges_pargs args; + args.privileges = &privileges; args.write(oprot_); oprot_->writeMessageEnd(); @@ -15133,7 +16095,7 @@ void ThriftHiveMetastoreClient::send_list_roles(const std::string& principal_nam oprot_->getTransport()->writeEnd(); } -void ThriftHiveMetastoreClient::recv_list_roles(std::vector & _return) +bool ThriftHiveMetastoreClient::recv_revoke_privileges() { int32_t rseqid = 0; @@ -15154,43 +16116,41 @@ void ThriftHiveMetastoreClient::recv_list_roles(std::vector & _return) iprot_->getTransport()->readEnd(); throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::INVALID_MESSAGE_TYPE); } - if (fname.compare("list_roles") != 0) { + if (fname.compare("revoke_privileges") != 0) { iprot_->skip(::apache::thrift::protocol::T_STRUCT); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::WRONG_METHOD_NAME); } - ThriftHiveMetastore_list_roles_presult result; + bool _return; + ThriftHiveMetastore_revoke_privileges_presult result; result.success = &_return; result.read(iprot_); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); if (result.__isset.success) { - // _return pointer has now been filled - return; + return _return; } if (result.__isset.o1) { throw result.o1; } - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "list_roles failed: unknown result"); + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "revoke_privileges failed: unknown result"); } -void ThriftHiveMetastoreClient::get_privilege_set(PrincipalPrivilegeSet& _return, const HiveObjectRef& hiveObject, const std::string& user_name, const std::vector & group_names) +void ThriftHiveMetastoreClient::get_delegation_token(std::string& _return, const std::string& renewer_kerberos_principal_name) { - send_get_privilege_set(hiveObject, user_name, group_names); - recv_get_privilege_set(_return); + send_get_delegation_token(renewer_kerberos_principal_name); + recv_get_delegation_token(_return); } -void ThriftHiveMetastoreClient::send_get_privilege_set(const HiveObjectRef& hiveObject, const std::string& user_name, const std::vector & group_names) +void ThriftHiveMetastoreClient::send_get_delegation_token(const std::string& renewer_kerberos_principal_name) { int32_t cseqid = 0; - oprot_->writeMessageBegin("get_privilege_set", ::apache::thrift::protocol::T_CALL, cseqid); + oprot_->writeMessageBegin("get_delegation_token", ::apache::thrift::protocol::T_CALL, cseqid); - ThriftHiveMetastore_get_privilege_set_pargs args; - args.hiveObject = &hiveObject; - args.user_name = &user_name; - args.group_names = &group_names; + ThriftHiveMetastore_get_delegation_token_pargs args; + args.renewer_kerberos_principal_name = &renewer_kerberos_principal_name; args.write(oprot_); oprot_->writeMessageEnd(); @@ -15198,7 +16158,7 @@ void ThriftHiveMetastoreClient::send_get_privilege_set(const HiveObjectRef& hive oprot_->getTransport()->writeEnd(); } -void ThriftHiveMetastoreClient::recv_get_privilege_set(PrincipalPrivilegeSet& _return) +void ThriftHiveMetastoreClient::recv_get_delegation_token(std::string& _return) { int32_t rseqid = 0; @@ -15219,13 +16179,13 @@ void ThriftHiveMetastoreClient::recv_get_privilege_set(PrincipalPrivilegeSet& _r iprot_->getTransport()->readEnd(); throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::INVALID_MESSAGE_TYPE); } - if (fname.compare("get_privilege_set") != 0) { + if (fname.compare("get_delegation_token") != 0) { iprot_->skip(::apache::thrift::protocol::T_STRUCT); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::WRONG_METHOD_NAME); } - ThriftHiveMetastore_get_privilege_set_presult result; + ThriftHiveMetastore_get_delegation_token_presult result; result.success = &_return; result.read(iprot_); iprot_->readMessageEnd(); @@ -15238,24 +16198,23 @@ void ThriftHiveMetastoreClient::recv_get_privilege_set(PrincipalPrivilegeSet& _r if (result.__isset.o1) { throw result.o1; } - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_privilege_set failed: unknown result"); + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_delegation_token failed: unknown result"); } -void ThriftHiveMetastoreClient::list_privileges(std::vector & _return, const std::string& principal_name, const PrincipalType::type principal_type, const HiveObjectRef& hiveObject) +void ThriftHiveMetastoreClient::get_delegation_token_with_signature(std::string& _return, const std::string& renewer_kerberos_principal_name, const std::string& token_signature) { - send_list_privileges(principal_name, principal_type, hiveObject); - recv_list_privileges(_return); + send_get_delegation_token_with_signature(renewer_kerberos_principal_name, token_signature); + recv_get_delegation_token_with_signature(_return); } -void ThriftHiveMetastoreClient::send_list_privileges(const std::string& principal_name, const PrincipalType::type principal_type, const HiveObjectRef& hiveObject) +void ThriftHiveMetastoreClient::send_get_delegation_token_with_signature(const std::string& renewer_kerberos_principal_name, const std::string& token_signature) { int32_t cseqid = 0; - oprot_->writeMessageBegin("list_privileges", ::apache::thrift::protocol::T_CALL, cseqid); + oprot_->writeMessageBegin("get_delegation_token_with_signature", ::apache::thrift::protocol::T_CALL, cseqid); - ThriftHiveMetastore_list_privileges_pargs args; - args.principal_name = &principal_name; - args.principal_type = &principal_type; - args.hiveObject = &hiveObject; + ThriftHiveMetastore_get_delegation_token_with_signature_pargs args; + args.renewer_kerberos_principal_name = &renewer_kerberos_principal_name; + args.token_signature = &token_signature; args.write(oprot_); oprot_->writeMessageEnd(); @@ -15263,7 +16222,7 @@ void ThriftHiveMetastoreClient::send_list_privileges(const std::string& principa oprot_->getTransport()->writeEnd(); } -void ThriftHiveMetastoreClient::recv_list_privileges(std::vector & _return) +void ThriftHiveMetastoreClient::recv_get_delegation_token_with_signature(std::string& _return) { int32_t rseqid = 0; @@ -15284,13 +16243,13 @@ void ThriftHiveMetastoreClient::recv_list_privileges(std::vectorgetTransport()->readEnd(); throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::INVALID_MESSAGE_TYPE); } - if (fname.compare("list_privileges") != 0) { + if (fname.compare("get_delegation_token_with_signature") != 0) { iprot_->skip(::apache::thrift::protocol::T_STRUCT); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::WRONG_METHOD_NAME); } - ThriftHiveMetastore_list_privileges_presult result; + ThriftHiveMetastore_get_delegation_token_with_signature_presult result; result.success = &_return; result.read(iprot_); iprot_->readMessageEnd(); @@ -15303,22 +16262,22 @@ void ThriftHiveMetastoreClient::recv_list_privileges(std::vectorwriteMessageBegin("grant_privileges", ::apache::thrift::protocol::T_CALL, cseqid); + oprot_->writeMessageBegin("renew_delegation_token", ::apache::thrift::protocol::T_CALL, cseqid); - ThriftHiveMetastore_grant_privileges_pargs args; - args.privileges = &privileges; + ThriftHiveMetastore_renew_delegation_token_pargs args; + args.token_str_form = &token_str_form; args.write(oprot_); oprot_->writeMessageEnd(); @@ -15326,7 +16285,7 @@ void ThriftHiveMetastoreClient::send_grant_privileges(const PrivilegeBag& privil oprot_->getTransport()->writeEnd(); } -bool ThriftHiveMetastoreClient::recv_grant_privileges() +int64_t ThriftHiveMetastoreClient::recv_renew_delegation_token() { int32_t rseqid = 0; @@ -15347,14 +16306,14 @@ bool ThriftHiveMetastoreClient::recv_grant_privileges() iprot_->getTransport()->readEnd(); throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::INVALID_MESSAGE_TYPE); } - if (fname.compare("grant_privileges") != 0) { + if (fname.compare("renew_delegation_token") != 0) { iprot_->skip(::apache::thrift::protocol::T_STRUCT); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::WRONG_METHOD_NAME); } - bool _return; - ThriftHiveMetastore_grant_privileges_presult result; + int64_t _return; + ThriftHiveMetastore_renew_delegation_token_presult result; result.success = &_return; result.read(iprot_); iprot_->readMessageEnd(); @@ -15366,22 +16325,22 @@ bool ThriftHiveMetastoreClient::recv_grant_privileges() if (result.__isset.o1) { throw result.o1; } - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "grant_privileges failed: unknown result"); + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "renew_delegation_token failed: unknown result"); } -bool ThriftHiveMetastoreClient::revoke_privileges(const PrivilegeBag& privileges) +void ThriftHiveMetastoreClient::cancel_delegation_token(const std::string& token_str_form) { - send_revoke_privileges(privileges); - return recv_revoke_privileges(); + send_cancel_delegation_token(token_str_form); + recv_cancel_delegation_token(); } -void ThriftHiveMetastoreClient::send_revoke_privileges(const PrivilegeBag& privileges) +void ThriftHiveMetastoreClient::send_cancel_delegation_token(const std::string& token_str_form) { int32_t cseqid = 0; - oprot_->writeMessageBegin("revoke_privileges", ::apache::thrift::protocol::T_CALL, cseqid); + oprot_->writeMessageBegin("cancel_delegation_token", ::apache::thrift::protocol::T_CALL, cseqid); - ThriftHiveMetastore_revoke_privileges_pargs args; - args.privileges = &privileges; + ThriftHiveMetastore_cancel_delegation_token_pargs args; + args.token_str_form = &token_str_form; args.write(oprot_); oprot_->writeMessageEnd(); @@ -15389,7 +16348,7 @@ void ThriftHiveMetastoreClient::send_revoke_privileges(const PrivilegeBag& privi oprot_->getTransport()->writeEnd(); } -bool ThriftHiveMetastoreClient::recv_revoke_privileges() +void ThriftHiveMetastoreClient::recv_cancel_delegation_token() { int32_t rseqid = 0; @@ -15410,26 +16369,21 @@ bool ThriftHiveMetastoreClient::recv_revoke_privileges() iprot_->getTransport()->readEnd(); throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::INVALID_MESSAGE_TYPE); } - if (fname.compare("revoke_privileges") != 0) { + if (fname.compare("cancel_delegation_token") != 0) { iprot_->skip(::apache::thrift::protocol::T_STRUCT); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::WRONG_METHOD_NAME); } - bool _return; - ThriftHiveMetastore_revoke_privileges_presult result; - result.success = &_return; + ThriftHiveMetastore_cancel_delegation_token_presult result; result.read(iprot_); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); - if (result.__isset.success) { - return _return; - } if (result.__isset.o1) { throw result.o1; } - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "revoke_privileges failed: unknown result"); + return; } bool ThriftHiveMetastoreProcessor::process(boost::shared_ptr< ::apache::thrift::protocol::TProtocol> piprot, boost::shared_ptr< ::apache::thrift::protocol::TProtocol> poprot) { @@ -17198,5 +18152,128 @@ void ThriftHiveMetastoreProcessor::process_revoke_privileges(int32_t seqid, ::ap oprot->getTransport()->writeEnd(); } +void ThriftHiveMetastoreProcessor::process_get_delegation_token(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot) +{ + ThriftHiveMetastore_get_delegation_token_args args; + args.read(iprot); + iprot->readMessageEnd(); + iprot->getTransport()->readEnd(); + + ThriftHiveMetastore_get_delegation_token_result result; + try { + iface_->get_delegation_token(result.success, args.renewer_kerberos_principal_name); + result.__isset.success = true; + } catch (MetaException &o1) { + result.o1 = o1; + result.__isset.o1 = true; + } catch (const std::exception& e) { + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("get_delegation_token", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->flush(); + oprot->getTransport()->writeEnd(); + return; + } + + oprot->writeMessageBegin("get_delegation_token", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->flush(); + oprot->getTransport()->writeEnd(); +} + +void ThriftHiveMetastoreProcessor::process_get_delegation_token_with_signature(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot) +{ + ThriftHiveMetastore_get_delegation_token_with_signature_args args; + args.read(iprot); + iprot->readMessageEnd(); + iprot->getTransport()->readEnd(); + + ThriftHiveMetastore_get_delegation_token_with_signature_result result; + try { + iface_->get_delegation_token_with_signature(result.success, args.renewer_kerberos_principal_name, args.token_signature); + result.__isset.success = true; + } catch (MetaException &o1) { + result.o1 = o1; + result.__isset.o1 = true; + } catch (const std::exception& e) { + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("get_delegation_token_with_signature", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->flush(); + oprot->getTransport()->writeEnd(); + return; + } + + oprot->writeMessageBegin("get_delegation_token_with_signature", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->flush(); + oprot->getTransport()->writeEnd(); +} + +void ThriftHiveMetastoreProcessor::process_renew_delegation_token(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot) +{ + ThriftHiveMetastore_renew_delegation_token_args args; + args.read(iprot); + iprot->readMessageEnd(); + iprot->getTransport()->readEnd(); + + ThriftHiveMetastore_renew_delegation_token_result result; + try { + result.success = iface_->renew_delegation_token(args.token_str_form); + result.__isset.success = true; + } catch (MetaException &o1) { + result.o1 = o1; + result.__isset.o1 = true; + } catch (const std::exception& e) { + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("renew_delegation_token", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->flush(); + oprot->getTransport()->writeEnd(); + return; + } + + oprot->writeMessageBegin("renew_delegation_token", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->flush(); + oprot->getTransport()->writeEnd(); +} + +void ThriftHiveMetastoreProcessor::process_cancel_delegation_token(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot) +{ + ThriftHiveMetastore_cancel_delegation_token_args args; + args.read(iprot); + iprot->readMessageEnd(); + iprot->getTransport()->readEnd(); + + ThriftHiveMetastore_cancel_delegation_token_result result; + try { + iface_->cancel_delegation_token(args.token_str_form); + } catch (MetaException &o1) { + result.o1 = o1; + result.__isset.o1 = true; + } catch (const std::exception& e) { + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("cancel_delegation_token", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->flush(); + oprot->getTransport()->writeEnd(); + return; + } + + oprot->writeMessageBegin("cancel_delegation_token", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->flush(); + oprot->getTransport()->writeEnd(); +} + }}} // namespace diff --git metastore/src/gen/thrift/gen-cpp/ThriftHiveMetastore.h metastore/src/gen/thrift/gen-cpp/ThriftHiveMetastore.h index 9029731..9b47ba8 100644 --- metastore/src/gen/thrift/gen-cpp/ThriftHiveMetastore.h +++ metastore/src/gen/thrift/gen-cpp/ThriftHiveMetastore.h @@ -67,6 +67,10 @@ class ThriftHiveMetastoreIf : virtual public facebook::fb303::FacebookServiceIf virtual void list_privileges(std::vector & _return, const std::string& principal_name, const PrincipalType::type principal_type, const HiveObjectRef& hiveObject) = 0; virtual bool grant_privileges(const PrivilegeBag& privileges) = 0; virtual bool revoke_privileges(const PrivilegeBag& privileges) = 0; + virtual void get_delegation_token(std::string& _return, const std::string& renewer_kerberos_principal_name) = 0; + virtual void get_delegation_token_with_signature(std::string& _return, const std::string& renewer_kerberos_principal_name, const std::string& token_signature) = 0; + virtual int64_t renew_delegation_token(const std::string& token_str_form) = 0; + virtual void cancel_delegation_token(const std::string& token_str_form) = 0; }; class ThriftHiveMetastoreNull : virtual public ThriftHiveMetastoreIf , virtual public facebook::fb303::FacebookServiceNull { @@ -239,6 +243,19 @@ class ThriftHiveMetastoreNull : virtual public ThriftHiveMetastoreIf , virtual p bool _return = false; return _return; } + void get_delegation_token(std::string& /* _return */, const std::string& /* renewer_kerberos_principal_name */) { + return; + } + void get_delegation_token_with_signature(std::string& /* _return */, const std::string& /* renewer_kerberos_principal_name */, const std::string& /* token_signature */) { + return; + } + int64_t renew_delegation_token(const std::string& /* token_str_form */) { + int64_t _return = 0; + return _return; + } + void cancel_delegation_token(const std::string& /* token_str_form */) { + return; + } }; typedef struct _ThriftHiveMetastore_create_database_args__isset { @@ -6337,6 +6354,429 @@ class ThriftHiveMetastore_revoke_privileges_presult { }; +typedef struct _ThriftHiveMetastore_get_delegation_token_args__isset { + _ThriftHiveMetastore_get_delegation_token_args__isset() : renewer_kerberos_principal_name(false) {} + bool renewer_kerberos_principal_name; +} _ThriftHiveMetastore_get_delegation_token_args__isset; + +class ThriftHiveMetastore_get_delegation_token_args { + public: + + ThriftHiveMetastore_get_delegation_token_args() : renewer_kerberos_principal_name("") { + } + + virtual ~ThriftHiveMetastore_get_delegation_token_args() throw() {} + + std::string renewer_kerberos_principal_name; + + _ThriftHiveMetastore_get_delegation_token_args__isset __isset; + + bool operator == (const ThriftHiveMetastore_get_delegation_token_args & rhs) const + { + if (!(renewer_kerberos_principal_name == rhs.renewer_kerberos_principal_name)) + return false; + return true; + } + bool operator != (const ThriftHiveMetastore_get_delegation_token_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_delegation_token_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_get_delegation_token_pargs { + public: + + + virtual ~ThriftHiveMetastore_get_delegation_token_pargs() throw() {} + + const std::string* renewer_kerberos_principal_name; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_delegation_token_result__isset { + _ThriftHiveMetastore_get_delegation_token_result__isset() : success(false), o1(false) {} + bool success; + bool o1; +} _ThriftHiveMetastore_get_delegation_token_result__isset; + +class ThriftHiveMetastore_get_delegation_token_result { + public: + + ThriftHiveMetastore_get_delegation_token_result() : success("") { + } + + virtual ~ThriftHiveMetastore_get_delegation_token_result() throw() {} + + std::string success; + MetaException o1; + + _ThriftHiveMetastore_get_delegation_token_result__isset __isset; + + bool operator == (const ThriftHiveMetastore_get_delegation_token_result & rhs) const + { + if (!(success == rhs.success)) + return false; + if (!(o1 == rhs.o1)) + return false; + return true; + } + bool operator != (const ThriftHiveMetastore_get_delegation_token_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_delegation_token_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_delegation_token_presult__isset { + _ThriftHiveMetastore_get_delegation_token_presult__isset() : success(false), o1(false) {} + bool success; + bool o1; +} _ThriftHiveMetastore_get_delegation_token_presult__isset; + +class ThriftHiveMetastore_get_delegation_token_presult { + public: + + + virtual ~ThriftHiveMetastore_get_delegation_token_presult() throw() {} + + std::string* success; + MetaException o1; + + _ThriftHiveMetastore_get_delegation_token_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_get_delegation_token_with_signature_args__isset { + _ThriftHiveMetastore_get_delegation_token_with_signature_args__isset() : renewer_kerberos_principal_name(false), token_signature(false) {} + bool renewer_kerberos_principal_name; + bool token_signature; +} _ThriftHiveMetastore_get_delegation_token_with_signature_args__isset; + +class ThriftHiveMetastore_get_delegation_token_with_signature_args { + public: + + ThriftHiveMetastore_get_delegation_token_with_signature_args() : renewer_kerberos_principal_name(""), token_signature("") { + } + + virtual ~ThriftHiveMetastore_get_delegation_token_with_signature_args() throw() {} + + std::string renewer_kerberos_principal_name; + std::string token_signature; + + _ThriftHiveMetastore_get_delegation_token_with_signature_args__isset __isset; + + bool operator == (const ThriftHiveMetastore_get_delegation_token_with_signature_args & rhs) const + { + if (!(renewer_kerberos_principal_name == rhs.renewer_kerberos_principal_name)) + return false; + if (!(token_signature == rhs.token_signature)) + return false; + return true; + } + bool operator != (const ThriftHiveMetastore_get_delegation_token_with_signature_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_delegation_token_with_signature_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_get_delegation_token_with_signature_pargs { + public: + + + virtual ~ThriftHiveMetastore_get_delegation_token_with_signature_pargs() throw() {} + + const std::string* renewer_kerberos_principal_name; + const std::string* token_signature; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_delegation_token_with_signature_result__isset { + _ThriftHiveMetastore_get_delegation_token_with_signature_result__isset() : success(false), o1(false) {} + bool success; + bool o1; +} _ThriftHiveMetastore_get_delegation_token_with_signature_result__isset; + +class ThriftHiveMetastore_get_delegation_token_with_signature_result { + public: + + ThriftHiveMetastore_get_delegation_token_with_signature_result() : success("") { + } + + virtual ~ThriftHiveMetastore_get_delegation_token_with_signature_result() throw() {} + + std::string success; + MetaException o1; + + _ThriftHiveMetastore_get_delegation_token_with_signature_result__isset __isset; + + bool operator == (const ThriftHiveMetastore_get_delegation_token_with_signature_result & rhs) const + { + if (!(success == rhs.success)) + return false; + if (!(o1 == rhs.o1)) + return false; + return true; + } + bool operator != (const ThriftHiveMetastore_get_delegation_token_with_signature_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_delegation_token_with_signature_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_delegation_token_with_signature_presult__isset { + _ThriftHiveMetastore_get_delegation_token_with_signature_presult__isset() : success(false), o1(false) {} + bool success; + bool o1; +} _ThriftHiveMetastore_get_delegation_token_with_signature_presult__isset; + +class ThriftHiveMetastore_get_delegation_token_with_signature_presult { + public: + + + virtual ~ThriftHiveMetastore_get_delegation_token_with_signature_presult() throw() {} + + std::string* success; + MetaException o1; + + _ThriftHiveMetastore_get_delegation_token_with_signature_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_renew_delegation_token_args__isset { + _ThriftHiveMetastore_renew_delegation_token_args__isset() : token_str_form(false) {} + bool token_str_form; +} _ThriftHiveMetastore_renew_delegation_token_args__isset; + +class ThriftHiveMetastore_renew_delegation_token_args { + public: + + ThriftHiveMetastore_renew_delegation_token_args() : token_str_form("") { + } + + virtual ~ThriftHiveMetastore_renew_delegation_token_args() throw() {} + + std::string token_str_form; + + _ThriftHiveMetastore_renew_delegation_token_args__isset __isset; + + bool operator == (const ThriftHiveMetastore_renew_delegation_token_args & rhs) const + { + if (!(token_str_form == rhs.token_str_form)) + return false; + return true; + } + bool operator != (const ThriftHiveMetastore_renew_delegation_token_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_renew_delegation_token_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_renew_delegation_token_pargs { + public: + + + virtual ~ThriftHiveMetastore_renew_delegation_token_pargs() throw() {} + + const std::string* token_str_form; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_renew_delegation_token_result__isset { + _ThriftHiveMetastore_renew_delegation_token_result__isset() : success(false), o1(false) {} + bool success; + bool o1; +} _ThriftHiveMetastore_renew_delegation_token_result__isset; + +class ThriftHiveMetastore_renew_delegation_token_result { + public: + + ThriftHiveMetastore_renew_delegation_token_result() : success(0) { + } + + virtual ~ThriftHiveMetastore_renew_delegation_token_result() throw() {} + + int64_t success; + MetaException o1; + + _ThriftHiveMetastore_renew_delegation_token_result__isset __isset; + + bool operator == (const ThriftHiveMetastore_renew_delegation_token_result & rhs) const + { + if (!(success == rhs.success)) + return false; + if (!(o1 == rhs.o1)) + return false; + return true; + } + bool operator != (const ThriftHiveMetastore_renew_delegation_token_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_renew_delegation_token_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_renew_delegation_token_presult__isset { + _ThriftHiveMetastore_renew_delegation_token_presult__isset() : success(false), o1(false) {} + bool success; + bool o1; +} _ThriftHiveMetastore_renew_delegation_token_presult__isset; + +class ThriftHiveMetastore_renew_delegation_token_presult { + public: + + + virtual ~ThriftHiveMetastore_renew_delegation_token_presult() throw() {} + + int64_t* success; + MetaException o1; + + _ThriftHiveMetastore_renew_delegation_token_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_cancel_delegation_token_args__isset { + _ThriftHiveMetastore_cancel_delegation_token_args__isset() : token_str_form(false) {} + bool token_str_form; +} _ThriftHiveMetastore_cancel_delegation_token_args__isset; + +class ThriftHiveMetastore_cancel_delegation_token_args { + public: + + ThriftHiveMetastore_cancel_delegation_token_args() : token_str_form("") { + } + + virtual ~ThriftHiveMetastore_cancel_delegation_token_args() throw() {} + + std::string token_str_form; + + _ThriftHiveMetastore_cancel_delegation_token_args__isset __isset; + + bool operator == (const ThriftHiveMetastore_cancel_delegation_token_args & rhs) const + { + if (!(token_str_form == rhs.token_str_form)) + return false; + return true; + } + bool operator != (const ThriftHiveMetastore_cancel_delegation_token_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_cancel_delegation_token_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_cancel_delegation_token_pargs { + public: + + + virtual ~ThriftHiveMetastore_cancel_delegation_token_pargs() throw() {} + + const std::string* token_str_form; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_cancel_delegation_token_result__isset { + _ThriftHiveMetastore_cancel_delegation_token_result__isset() : o1(false) {} + bool o1; +} _ThriftHiveMetastore_cancel_delegation_token_result__isset; + +class ThriftHiveMetastore_cancel_delegation_token_result { + public: + + ThriftHiveMetastore_cancel_delegation_token_result() { + } + + virtual ~ThriftHiveMetastore_cancel_delegation_token_result() throw() {} + + MetaException o1; + + _ThriftHiveMetastore_cancel_delegation_token_result__isset __isset; + + bool operator == (const ThriftHiveMetastore_cancel_delegation_token_result & rhs) const + { + if (!(o1 == rhs.o1)) + return false; + return true; + } + bool operator != (const ThriftHiveMetastore_cancel_delegation_token_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_cancel_delegation_token_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_cancel_delegation_token_presult__isset { + _ThriftHiveMetastore_cancel_delegation_token_presult__isset() : o1(false) {} + bool o1; +} _ThriftHiveMetastore_cancel_delegation_token_presult__isset; + +class ThriftHiveMetastore_cancel_delegation_token_presult { + public: + + + virtual ~ThriftHiveMetastore_cancel_delegation_token_presult() throw() {} + + MetaException o1; + + _ThriftHiveMetastore_cancel_delegation_token_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + class ThriftHiveMetastoreClient : virtual public ThriftHiveMetastoreIf, public facebook::fb303::FacebookServiceClient { public: ThriftHiveMetastoreClient(boost::shared_ptr< ::apache::thrift::protocol::TProtocol> prot) : @@ -6505,6 +6945,18 @@ class ThriftHiveMetastoreClient : virtual public ThriftHiveMetastoreIf, public f bool revoke_privileges(const PrivilegeBag& privileges); void send_revoke_privileges(const PrivilegeBag& privileges); bool recv_revoke_privileges(); + void get_delegation_token(std::string& _return, const std::string& renewer_kerberos_principal_name); + void send_get_delegation_token(const std::string& renewer_kerberos_principal_name); + void recv_get_delegation_token(std::string& _return); + void get_delegation_token_with_signature(std::string& _return, const std::string& renewer_kerberos_principal_name, const std::string& token_signature); + void send_get_delegation_token_with_signature(const std::string& renewer_kerberos_principal_name, const std::string& token_signature); + void recv_get_delegation_token_with_signature(std::string& _return); + int64_t renew_delegation_token(const std::string& token_str_form); + void send_renew_delegation_token(const std::string& token_str_form); + int64_t recv_renew_delegation_token(); + void cancel_delegation_token(const std::string& token_str_form); + void send_cancel_delegation_token(const std::string& token_str_form); + void recv_cancel_delegation_token(); }; class ThriftHiveMetastoreProcessor : virtual public ::apache::thrift::TProcessor, public facebook::fb303::FacebookServiceProcessor { @@ -6565,6 +7017,10 @@ class ThriftHiveMetastoreProcessor : virtual public ::apache::thrift::TProcessor void process_list_privileges(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot); void process_grant_privileges(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot); void process_revoke_privileges(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot); + void process_get_delegation_token(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot); + void process_get_delegation_token_with_signature(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot); + void process_renew_delegation_token(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot); + void process_cancel_delegation_token(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot); public: ThriftHiveMetastoreProcessor(boost::shared_ptr iface) : facebook::fb303::FacebookServiceProcessor(iface), @@ -6621,6 +7077,10 @@ class ThriftHiveMetastoreProcessor : virtual public ::apache::thrift::TProcessor processMap_["list_privileges"] = &ThriftHiveMetastoreProcessor::process_list_privileges; processMap_["grant_privileges"] = &ThriftHiveMetastoreProcessor::process_grant_privileges; processMap_["revoke_privileges"] = &ThriftHiveMetastoreProcessor::process_revoke_privileges; + processMap_["get_delegation_token"] = &ThriftHiveMetastoreProcessor::process_get_delegation_token; + processMap_["get_delegation_token_with_signature"] = &ThriftHiveMetastoreProcessor::process_get_delegation_token_with_signature; + processMap_["renew_delegation_token"] = &ThriftHiveMetastoreProcessor::process_renew_delegation_token; + processMap_["cancel_delegation_token"] = &ThriftHiveMetastoreProcessor::process_cancel_delegation_token; } virtual bool process(boost::shared_ptr< ::apache::thrift::protocol::TProtocol> piprot, boost::shared_ptr< ::apache::thrift::protocol::TProtocol> poprot); @@ -7217,6 +7677,48 @@ class ThriftHiveMetastoreMultiface : virtual public ThriftHiveMetastoreIf, publi } } + void get_delegation_token(std::string& _return, const std::string& renewer_kerberos_principal_name) { + uint32_t sz = ifaces_.size(); + for (uint32_t i = 0; i < sz; ++i) { + if (i == sz - 1) { + ifaces_[i]->get_delegation_token(_return, renewer_kerberos_principal_name); + return; + } else { + ifaces_[i]->get_delegation_token(_return, renewer_kerberos_principal_name); + } + } + } + + void get_delegation_token_with_signature(std::string& _return, const std::string& renewer_kerberos_principal_name, const std::string& token_signature) { + uint32_t sz = ifaces_.size(); + for (uint32_t i = 0; i < sz; ++i) { + if (i == sz - 1) { + ifaces_[i]->get_delegation_token_with_signature(_return, renewer_kerberos_principal_name, token_signature); + return; + } else { + ifaces_[i]->get_delegation_token_with_signature(_return, renewer_kerberos_principal_name, token_signature); + } + } + } + + int64_t renew_delegation_token(const std::string& token_str_form) { + uint32_t sz = ifaces_.size(); + for (uint32_t i = 0; i < sz; ++i) { + if (i == sz - 1) { + return ifaces_[i]->renew_delegation_token(token_str_form); + } else { + ifaces_[i]->renew_delegation_token(token_str_form); + } + } + } + + void cancel_delegation_token(const std::string& token_str_form) { + uint32_t sz = ifaces_.size(); + for (uint32_t i = 0; i < sz; ++i) { + ifaces_[i]->cancel_delegation_token(token_str_form); + } + } + }; }}} // namespace diff --git metastore/src/gen/thrift/gen-cpp/ThriftHiveMetastore_server.skeleton.cpp metastore/src/gen/thrift/gen-cpp/ThriftHiveMetastore_server.skeleton.cpp index 3ebe300..37e5660 100644 --- metastore/src/gen/thrift/gen-cpp/ThriftHiveMetastore_server.skeleton.cpp +++ metastore/src/gen/thrift/gen-cpp/ThriftHiveMetastore_server.skeleton.cpp @@ -282,6 +282,26 @@ class ThriftHiveMetastoreHandler : virtual public ThriftHiveMetastoreIf { printf("revoke_privileges\n"); } + void get_delegation_token(std::string& _return, const std::string& renewer_kerberos_principal_name) { + // Your implementation goes here + printf("get_delegation_token\n"); + } + + void get_delegation_token_with_signature(std::string& _return, const std::string& renewer_kerberos_principal_name, const std::string& token_signature) { + // Your implementation goes here + printf("get_delegation_token_with_signature\n"); + } + + int64_t renew_delegation_token(const std::string& token_str_form) { + // Your implementation goes here + printf("renew_delegation_token\n"); + } + + void cancel_delegation_token(const std::string& token_str_form) { + // Your implementation goes here + printf("cancel_delegation_token\n"); + } + }; int main(int argc, char **argv) { diff --git metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/ThriftHiveMetastore.java metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/ThriftHiveMetastore.java index 72c0feb..39ffd7d 100644 --- metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/ThriftHiveMetastore.java +++ metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/ThriftHiveMetastore.java @@ -137,6 +137,14 @@ public class ThriftHiveMetastore { public boolean revoke_privileges(PrivilegeBag privileges) throws MetaException, TException; + public String get_delegation_token(String renewer_kerberos_principal_name) throws MetaException, TException; + + public String get_delegation_token_with_signature(String renewer_kerberos_principal_name, String token_signature) throws MetaException, TException; + + public long renew_delegation_token(String token_str_form) throws MetaException, TException; + + public void cancel_delegation_token(String token_str_form) throws MetaException, TException; + } public interface AsyncIface extends com.facebook.fb303.FacebookService .AsyncIface { @@ -245,6 +253,14 @@ public class ThriftHiveMetastore { public void revoke_privileges(PrivilegeBag privileges, AsyncMethodCallback resultHandler) throws TException; + public void get_delegation_token(String renewer_kerberos_principal_name, AsyncMethodCallback resultHandler) throws TException; + + public void get_delegation_token_with_signature(String renewer_kerberos_principal_name, String token_signature, AsyncMethodCallback resultHandler) throws TException; + + public void renew_delegation_token(String token_str_form, AsyncMethodCallback resultHandler) throws TException; + + public void cancel_delegation_token(String token_str_form, AsyncMethodCallback resultHandler) throws TException; + } public static class Client extends com.facebook.fb303.FacebookService.Client implements TServiceClient, Iface { @@ -2475,6 +2491,160 @@ public class ThriftHiveMetastore { throw new TApplicationException(TApplicationException.MISSING_RESULT, "revoke_privileges failed: unknown result"); } + public String get_delegation_token(String renewer_kerberos_principal_name) throws MetaException, TException + { + send_get_delegation_token(renewer_kerberos_principal_name); + return recv_get_delegation_token(); + } + + public void send_get_delegation_token(String renewer_kerberos_principal_name) throws TException + { + oprot_.writeMessageBegin(new TMessage("get_delegation_token", TMessageType.CALL, ++seqid_)); + get_delegation_token_args args = new get_delegation_token_args(); + args.setRenewer_kerberos_principal_name(renewer_kerberos_principal_name); + args.write(oprot_); + oprot_.writeMessageEnd(); + oprot_.getTransport().flush(); + } + + public String recv_get_delegation_token() throws MetaException, TException + { + TMessage msg = iprot_.readMessageBegin(); + if (msg.type == TMessageType.EXCEPTION) { + TApplicationException x = TApplicationException.read(iprot_); + iprot_.readMessageEnd(); + throw x; + } + if (msg.seqid != seqid_) { + throw new TApplicationException(TApplicationException.BAD_SEQUENCE_ID, "get_delegation_token failed: out of sequence response"); + } + get_delegation_token_result result = new get_delegation_token_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_delegation_token failed: unknown result"); + } + + public String get_delegation_token_with_signature(String renewer_kerberos_principal_name, String token_signature) throws MetaException, TException + { + send_get_delegation_token_with_signature(renewer_kerberos_principal_name, token_signature); + return recv_get_delegation_token_with_signature(); + } + + public void send_get_delegation_token_with_signature(String renewer_kerberos_principal_name, String token_signature) throws TException + { + oprot_.writeMessageBegin(new TMessage("get_delegation_token_with_signature", TMessageType.CALL, ++seqid_)); + get_delegation_token_with_signature_args args = new get_delegation_token_with_signature_args(); + args.setRenewer_kerberos_principal_name(renewer_kerberos_principal_name); + args.setToken_signature(token_signature); + args.write(oprot_); + oprot_.writeMessageEnd(); + oprot_.getTransport().flush(); + } + + public String recv_get_delegation_token_with_signature() throws MetaException, TException + { + TMessage msg = iprot_.readMessageBegin(); + if (msg.type == TMessageType.EXCEPTION) { + TApplicationException x = TApplicationException.read(iprot_); + iprot_.readMessageEnd(); + throw x; + } + if (msg.seqid != seqid_) { + throw new TApplicationException(TApplicationException.BAD_SEQUENCE_ID, "get_delegation_token_with_signature failed: out of sequence response"); + } + get_delegation_token_with_signature_result result = new get_delegation_token_with_signature_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_delegation_token_with_signature failed: unknown result"); + } + + public long renew_delegation_token(String token_str_form) throws MetaException, TException + { + send_renew_delegation_token(token_str_form); + return recv_renew_delegation_token(); + } + + public void send_renew_delegation_token(String token_str_form) throws TException + { + oprot_.writeMessageBegin(new TMessage("renew_delegation_token", TMessageType.CALL, ++seqid_)); + renew_delegation_token_args args = new renew_delegation_token_args(); + args.setToken_str_form(token_str_form); + args.write(oprot_); + oprot_.writeMessageEnd(); + oprot_.getTransport().flush(); + } + + public long recv_renew_delegation_token() throws MetaException, TException + { + TMessage msg = iprot_.readMessageBegin(); + if (msg.type == TMessageType.EXCEPTION) { + TApplicationException x = TApplicationException.read(iprot_); + iprot_.readMessageEnd(); + throw x; + } + if (msg.seqid != seqid_) { + throw new TApplicationException(TApplicationException.BAD_SEQUENCE_ID, "renew_delegation_token failed: out of sequence response"); + } + renew_delegation_token_result result = new renew_delegation_token_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, "renew_delegation_token failed: unknown result"); + } + + public void cancel_delegation_token(String token_str_form) throws MetaException, TException + { + send_cancel_delegation_token(token_str_form); + recv_cancel_delegation_token(); + } + + public void send_cancel_delegation_token(String token_str_form) throws TException + { + oprot_.writeMessageBegin(new TMessage("cancel_delegation_token", TMessageType.CALL, ++seqid_)); + cancel_delegation_token_args args = new cancel_delegation_token_args(); + args.setToken_str_form(token_str_form); + args.write(oprot_); + oprot_.writeMessageEnd(); + oprot_.getTransport().flush(); + } + + public void recv_cancel_delegation_token() throws MetaException, TException + { + TMessage msg = iprot_.readMessageBegin(); + if (msg.type == TMessageType.EXCEPTION) { + TApplicationException x = TApplicationException.read(iprot_); + iprot_.readMessageEnd(); + throw x; + } + if (msg.seqid != seqid_) { + throw new TApplicationException(TApplicationException.BAD_SEQUENCE_ID, "cancel_delegation_token failed: out of sequence response"); + } + cancel_delegation_token_result result = new cancel_delegation_token_result(); + result.read(iprot_); + iprot_.readMessageEnd(); + if (result.o1 != null) { + throw result.o1; + } + return; + } + } public static class AsyncClient extends com.facebook.fb303.FacebookService.AsyncClient implements AsyncIface { public static class Factory implements TAsyncClientFactory { @@ -4336,6 +4506,133 @@ public class ThriftHiveMetastore { } } + public void get_delegation_token(String renewer_kerberos_principal_name, AsyncMethodCallback resultHandler) throws TException { + checkReady(); + get_delegation_token_call method_call = new get_delegation_token_call(renewer_kerberos_principal_name, resultHandler, this, protocolFactory, transport); + manager.call(method_call); + } + + public static class get_delegation_token_call extends TAsyncMethodCall { + private String renewer_kerberos_principal_name; + public get_delegation_token_call(String renewer_kerberos_principal_name, AsyncMethodCallback resultHandler, TAsyncClient client, TProtocolFactory protocolFactory, TNonblockingTransport transport) throws TException { + super(client, protocolFactory, transport, resultHandler, false); + this.renewer_kerberos_principal_name = renewer_kerberos_principal_name; + } + + public void write_args(TProtocol prot) throws TException { + prot.writeMessageBegin(new TMessage("get_delegation_token", TMessageType.CALL, 0)); + get_delegation_token_args args = new get_delegation_token_args(); + args.setRenewer_kerberos_principal_name(renewer_kerberos_principal_name); + args.write(prot); + prot.writeMessageEnd(); + } + + public String getResult() throws MetaException, TException { + if (getState() != State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + TMemoryInputTransport memoryTransport = new TMemoryInputTransport(getFrameBuffer().array()); + TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_get_delegation_token(); + } + } + + public void get_delegation_token_with_signature(String renewer_kerberos_principal_name, String token_signature, AsyncMethodCallback resultHandler) throws TException { + checkReady(); + get_delegation_token_with_signature_call method_call = new get_delegation_token_with_signature_call(renewer_kerberos_principal_name, token_signature, resultHandler, this, protocolFactory, transport); + manager.call(method_call); + } + + public static class get_delegation_token_with_signature_call extends TAsyncMethodCall { + private String renewer_kerberos_principal_name; + private String token_signature; + public get_delegation_token_with_signature_call(String renewer_kerberos_principal_name, String token_signature, AsyncMethodCallback resultHandler, TAsyncClient client, TProtocolFactory protocolFactory, TNonblockingTransport transport) throws TException { + super(client, protocolFactory, transport, resultHandler, false); + this.renewer_kerberos_principal_name = renewer_kerberos_principal_name; + this.token_signature = token_signature; + } + + public void write_args(TProtocol prot) throws TException { + prot.writeMessageBegin(new TMessage("get_delegation_token_with_signature", TMessageType.CALL, 0)); + get_delegation_token_with_signature_args args = new get_delegation_token_with_signature_args(); + args.setRenewer_kerberos_principal_name(renewer_kerberos_principal_name); + args.setToken_signature(token_signature); + args.write(prot); + prot.writeMessageEnd(); + } + + public String getResult() throws MetaException, TException { + if (getState() != State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + TMemoryInputTransport memoryTransport = new TMemoryInputTransport(getFrameBuffer().array()); + TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_get_delegation_token_with_signature(); + } + } + + public void renew_delegation_token(String token_str_form, AsyncMethodCallback resultHandler) throws TException { + checkReady(); + renew_delegation_token_call method_call = new renew_delegation_token_call(token_str_form, resultHandler, this, protocolFactory, transport); + manager.call(method_call); + } + + public static class renew_delegation_token_call extends TAsyncMethodCall { + private String token_str_form; + public renew_delegation_token_call(String token_str_form, AsyncMethodCallback resultHandler, TAsyncClient client, TProtocolFactory protocolFactory, TNonblockingTransport transport) throws TException { + super(client, protocolFactory, transport, resultHandler, false); + this.token_str_form = token_str_form; + } + + public void write_args(TProtocol prot) throws TException { + prot.writeMessageBegin(new TMessage("renew_delegation_token", TMessageType.CALL, 0)); + renew_delegation_token_args args = new renew_delegation_token_args(); + args.setToken_str_form(token_str_form); + args.write(prot); + prot.writeMessageEnd(); + } + + public long getResult() throws MetaException, TException { + if (getState() != State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + TMemoryInputTransport memoryTransport = new TMemoryInputTransport(getFrameBuffer().array()); + TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_renew_delegation_token(); + } + } + + public void cancel_delegation_token(String token_str_form, AsyncMethodCallback resultHandler) throws TException { + checkReady(); + cancel_delegation_token_call method_call = new cancel_delegation_token_call(token_str_form, resultHandler, this, protocolFactory, transport); + manager.call(method_call); + } + + public static class cancel_delegation_token_call extends TAsyncMethodCall { + private String token_str_form; + public cancel_delegation_token_call(String token_str_form, AsyncMethodCallback resultHandler, TAsyncClient client, TProtocolFactory protocolFactory, TNonblockingTransport transport) throws TException { + super(client, protocolFactory, transport, resultHandler, false); + this.token_str_form = token_str_form; + } + + public void write_args(TProtocol prot) throws TException { + prot.writeMessageBegin(new TMessage("cancel_delegation_token", TMessageType.CALL, 0)); + cancel_delegation_token_args args = new cancel_delegation_token_args(); + args.setToken_str_form(token_str_form); + args.write(prot); + prot.writeMessageEnd(); + } + + public void getResult() throws MetaException, TException { + if (getState() != State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + TMemoryInputTransport memoryTransport = new TMemoryInputTransport(getFrameBuffer().array()); + TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + (new Client(prot)).recv_cancel_delegation_token(); + } + } + } public static class Processor extends com.facebook.fb303.FacebookService.Processor implements TProcessor { @@ -4396,6 +4693,10 @@ public class ThriftHiveMetastore { processMap_.put("list_privileges", new list_privileges()); processMap_.put("grant_privileges", new grant_privileges()); processMap_.put("revoke_privileges", new revoke_privileges()); + processMap_.put("get_delegation_token", new get_delegation_token()); + processMap_.put("get_delegation_token_with_signature", new get_delegation_token_with_signature()); + processMap_.put("renew_delegation_token", new renew_delegation_token()); + processMap_.put("cancel_delegation_token", new cancel_delegation_token()); } private Iface iface_; @@ -6489,6 +6790,159 @@ public class ThriftHiveMetastore { } + private class get_delegation_token implements ProcessFunction { + public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException + { + get_delegation_token_args args = new get_delegation_token_args(); + try { + args.read(iprot); + } catch (TProtocolException e) { + iprot.readMessageEnd(); + TApplicationException x = new TApplicationException(TApplicationException.PROTOCOL_ERROR, e.getMessage()); + oprot.writeMessageBegin(new TMessage("get_delegation_token", TMessageType.EXCEPTION, seqid)); + x.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + return; + } + iprot.readMessageEnd(); + get_delegation_token_result result = new get_delegation_token_result(); + try { + result.success = iface_.get_delegation_token(args.renewer_kerberos_principal_name); + } catch (MetaException o1) { + result.o1 = o1; + } catch (Throwable th) { + LOGGER.error("Internal error processing get_delegation_token", th); + TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing get_delegation_token"); + oprot.writeMessageBegin(new TMessage("get_delegation_token", TMessageType.EXCEPTION, seqid)); + x.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + return; + } + oprot.writeMessageBegin(new TMessage("get_delegation_token", TMessageType.REPLY, seqid)); + result.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + } + + } + + private class get_delegation_token_with_signature implements ProcessFunction { + public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException + { + get_delegation_token_with_signature_args args = new get_delegation_token_with_signature_args(); + try { + args.read(iprot); + } catch (TProtocolException e) { + iprot.readMessageEnd(); + TApplicationException x = new TApplicationException(TApplicationException.PROTOCOL_ERROR, e.getMessage()); + oprot.writeMessageBegin(new TMessage("get_delegation_token_with_signature", TMessageType.EXCEPTION, seqid)); + x.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + return; + } + iprot.readMessageEnd(); + get_delegation_token_with_signature_result result = new get_delegation_token_with_signature_result(); + try { + result.success = iface_.get_delegation_token_with_signature(args.renewer_kerberos_principal_name, args.token_signature); + } catch (MetaException o1) { + result.o1 = o1; + } catch (Throwable th) { + LOGGER.error("Internal error processing get_delegation_token_with_signature", th); + TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing get_delegation_token_with_signature"); + oprot.writeMessageBegin(new TMessage("get_delegation_token_with_signature", TMessageType.EXCEPTION, seqid)); + x.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + return; + } + oprot.writeMessageBegin(new TMessage("get_delegation_token_with_signature", TMessageType.REPLY, seqid)); + result.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + } + + } + + private class renew_delegation_token implements ProcessFunction { + public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException + { + renew_delegation_token_args args = new renew_delegation_token_args(); + try { + args.read(iprot); + } catch (TProtocolException e) { + iprot.readMessageEnd(); + TApplicationException x = new TApplicationException(TApplicationException.PROTOCOL_ERROR, e.getMessage()); + oprot.writeMessageBegin(new TMessage("renew_delegation_token", TMessageType.EXCEPTION, seqid)); + x.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + return; + } + iprot.readMessageEnd(); + renew_delegation_token_result result = new renew_delegation_token_result(); + try { + result.success = iface_.renew_delegation_token(args.token_str_form); + result.setSuccessIsSet(true); + } catch (MetaException o1) { + result.o1 = o1; + } catch (Throwable th) { + LOGGER.error("Internal error processing renew_delegation_token", th); + TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing renew_delegation_token"); + oprot.writeMessageBegin(new TMessage("renew_delegation_token", TMessageType.EXCEPTION, seqid)); + x.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + return; + } + oprot.writeMessageBegin(new TMessage("renew_delegation_token", TMessageType.REPLY, seqid)); + result.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + } + + } + + private class cancel_delegation_token implements ProcessFunction { + public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException + { + cancel_delegation_token_args args = new cancel_delegation_token_args(); + try { + args.read(iprot); + } catch (TProtocolException e) { + iprot.readMessageEnd(); + TApplicationException x = new TApplicationException(TApplicationException.PROTOCOL_ERROR, e.getMessage()); + oprot.writeMessageBegin(new TMessage("cancel_delegation_token", TMessageType.EXCEPTION, seqid)); + x.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + return; + } + iprot.readMessageEnd(); + cancel_delegation_token_result result = new cancel_delegation_token_result(); + try { + iface_.cancel_delegation_token(args.token_str_form); + } catch (MetaException o1) { + result.o1 = o1; + } catch (Throwable th) { + LOGGER.error("Internal error processing cancel_delegation_token", th); + TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing cancel_delegation_token"); + oprot.writeMessageBegin(new TMessage("cancel_delegation_token", TMessageType.EXCEPTION, seqid)); + x.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + return; + } + oprot.writeMessageBegin(new TMessage("cancel_delegation_token", TMessageType.REPLY, seqid)); + result.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + } + + } + } public static class create_database_args implements TBase, java.io.Serializable, Cloneable { @@ -46024,76 +46478,3395 @@ public class ThriftHiveMetastore { } // isset id assignments - private static final int __SUCCESS_ISSET_ID = 0; - private BitSet __isset_bit_vector = new BitSet(1); + private static final int __SUCCESS_ISSET_ID = 0; + private BitSet __isset_bit_vector = new BitSet(1); + + public static final Map<_Fields, FieldMetaData> metaDataMap; + static { + Map<_Fields, FieldMetaData> tmpMap = new EnumMap<_Fields, FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.BOOL))); + tmpMap.put(_Fields.O1, new FieldMetaData("o1", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRUCT))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + FieldMetaData.addStructMetaDataMap(grant_role_result.class, metaDataMap); + } + + public grant_role_result() { + } + + public grant_role_result( + boolean success, + MetaException o1) + { + this(); + this.success = success; + setSuccessIsSet(true); + this.o1 = o1; + } + + /** + * Performs a deep copy on other. + */ + public grant_role_result(grant_role_result other) { + __isset_bit_vector.clear(); + __isset_bit_vector.or(other.__isset_bit_vector); + this.success = other.success; + if (other.isSetO1()) { + this.o1 = new MetaException(other.o1); + } + } + + public grant_role_result deepCopy() { + return new grant_role_result(this); + } + + @Override + public void clear() { + setSuccessIsSet(false); + this.success = false; + this.o1 = null; + } + + public boolean isSuccess() { + return this.success; + } + + public void setSuccess(boolean success) { + this.success = success; + setSuccessIsSet(true); + } + + public void unsetSuccess() { + __isset_bit_vector.clear(__SUCCESS_ISSET_ID); + } + + /** Returns true if field success is set (has been asigned a value) and false otherwise */ + public boolean isSetSuccess() { + return __isset_bit_vector.get(__SUCCESS_ISSET_ID); + } + + public void setSuccessIsSet(boolean value) { + __isset_bit_vector.set(__SUCCESS_ISSET_ID, value); + } + + 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 setO1IsSet(boolean value) { + if (!value) { + this.o1 = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((Boolean)value); + } + break; + + case O1: + if (value == null) { + unsetO1(); + } else { + setO1((MetaException)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return new Boolean(isSuccess()); + + case O1: + return getO1(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case SUCCESS: + return isSetSuccess(); + case O1: + return isSetO1(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof grant_role_result) + return this.equals((grant_role_result)that); + return false; + } + + public boolean equals(grant_role_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; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + public int compareTo(grant_role_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + grant_role_result typedOther = (grant_role_result)other; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = TBaseHelper.compareTo(this.success, typedOther.success); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetO1()).compareTo(typedOther.isSetO1()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetO1()) { + lastComparison = TBaseHelper.compareTo(this.o1, typedOther.o1); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(TProtocol iprot) throws TException { + TField field; + iprot.readStructBegin(); + while (true) + { + field = iprot.readFieldBegin(); + if (field.type == TType.STOP) { + break; + } + switch (field.id) { + case 0: // SUCCESS + if (field.type == TType.BOOL) { + this.success = iprot.readBool(); + setSuccessIsSet(true); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 1: // 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); + } + 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(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("grant_role_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; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws TException { + // check for required fields + } + + } + + public static class revoke_role_args implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("revoke_role_args"); + + private static final TField ROLE_NAME_FIELD_DESC = new TField("role_name", TType.STRING, (short)1); + private static final TField PRINCIPAL_NAME_FIELD_DESC = new TField("principal_name", TType.STRING, (short)2); + private static final TField PRINCIPAL_TYPE_FIELD_DESC = new TField("principal_type", TType.I32, (short)3); + + private String role_name; + private String principal_name; + private PrincipalType principal_type; + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements TFieldIdEnum { + ROLE_NAME((short)1, "role_name"), + PRINCIPAL_NAME((short)2, "principal_name"), + /** + * + * @see PrincipalType + */ + PRINCIPAL_TYPE((short)3, "principal_type"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // ROLE_NAME + return ROLE_NAME; + case 2: // PRINCIPAL_NAME + return PRINCIPAL_NAME; + case 3: // PRINCIPAL_TYPE + return PRINCIPAL_TYPE; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + + public static final Map<_Fields, FieldMetaData> metaDataMap; + static { + Map<_Fields, FieldMetaData> tmpMap = new EnumMap<_Fields, FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.ROLE_NAME, new FieldMetaData("role_name", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + tmpMap.put(_Fields.PRINCIPAL_NAME, new FieldMetaData("principal_name", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + tmpMap.put(_Fields.PRINCIPAL_TYPE, new FieldMetaData("principal_type", TFieldRequirementType.DEFAULT, + new EnumMetaData(TType.ENUM, PrincipalType.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + FieldMetaData.addStructMetaDataMap(revoke_role_args.class, metaDataMap); + } + + public revoke_role_args() { + } + + public revoke_role_args( + String role_name, + String principal_name, + PrincipalType principal_type) + { + this(); + this.role_name = role_name; + this.principal_name = principal_name; + this.principal_type = principal_type; + } + + /** + * Performs a deep copy on other. + */ + public revoke_role_args(revoke_role_args other) { + if (other.isSetRole_name()) { + this.role_name = other.role_name; + } + if (other.isSetPrincipal_name()) { + this.principal_name = other.principal_name; + } + if (other.isSetPrincipal_type()) { + this.principal_type = other.principal_type; + } + } + + public revoke_role_args deepCopy() { + return new revoke_role_args(this); + } + + @Override + public void clear() { + this.role_name = null; + this.principal_name = null; + this.principal_type = null; + } + + public String getRole_name() { + return this.role_name; + } + + public void setRole_name(String role_name) { + this.role_name = role_name; + } + + public void unsetRole_name() { + this.role_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 void setRole_nameIsSet(boolean value) { + if (!value) { + this.role_name = null; + } + } + + 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 void setPrincipal_nameIsSet(boolean value) { + if (!value) { + this.principal_name = null; + } + } + + /** + * + * @see PrincipalType + */ + public PrincipalType getPrincipal_type() { + return this.principal_type; + } + + /** + * + * @see PrincipalType + */ + public void setPrincipal_type(PrincipalType principal_type) { + this.principal_type = principal_type; + } + + public void unsetPrincipal_type() { + this.principal_type = null; + } + + /** Returns true if field principal_type is set (has been asigned a value) and false otherwise */ + public boolean isSetPrincipal_type() { + return this.principal_type != null; + } + + public void setPrincipal_typeIsSet(boolean value) { + if (!value) { + this.principal_type = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case ROLE_NAME: + if (value == null) { + unsetRole_name(); + } else { + setRole_name((String)value); + } + break; + + case PRINCIPAL_NAME: + if (value == null) { + unsetPrincipal_name(); + } else { + setPrincipal_name((String)value); + } + break; + + case PRINCIPAL_TYPE: + if (value == null) { + unsetPrincipal_type(); + } else { + setPrincipal_type((PrincipalType)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case ROLE_NAME: + return getRole_name(); + + case PRINCIPAL_NAME: + return getPrincipal_name(); + + case PRINCIPAL_TYPE: + return getPrincipal_type(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case ROLE_NAME: + return isSetRole_name(); + case PRINCIPAL_NAME: + return isSetPrincipal_name(); + case PRINCIPAL_TYPE: + return isSetPrincipal_type(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof revoke_role_args) + return this.equals((revoke_role_args)that); + return false; + } + + public boolean equals(revoke_role_args that) { + if (that == null) + return false; + + 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.role_name.equals(that.role_name)) + return false; + } + + 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.principal_name.equals(that.principal_name)) + return false; + } + + boolean this_present_principal_type = true && this.isSetPrincipal_type(); + boolean that_present_principal_type = true && that.isSetPrincipal_type(); + if (this_present_principal_type || that_present_principal_type) { + if (!(this_present_principal_type && that_present_principal_type)) + return false; + if (!this.principal_type.equals(that.principal_type)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + public int compareTo(revoke_role_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + revoke_role_args typedOther = (revoke_role_args)other; + + lastComparison = Boolean.valueOf(isSetRole_name()).compareTo(typedOther.isSetRole_name()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetRole_name()) { + lastComparison = TBaseHelper.compareTo(this.role_name, typedOther.role_name); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetPrincipal_name()).compareTo(typedOther.isSetPrincipal_name()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetPrincipal_name()) { + lastComparison = TBaseHelper.compareTo(this.principal_name, typedOther.principal_name); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetPrincipal_type()).compareTo(typedOther.isSetPrincipal_type()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetPrincipal_type()) { + lastComparison = TBaseHelper.compareTo(this.principal_type, typedOther.principal_type); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(TProtocol iprot) throws TException { + TField field; + iprot.readStructBegin(); + while (true) + { + field = iprot.readFieldBegin(); + if (field.type == TType.STOP) { + break; + } + switch (field.id) { + case 1: // ROLE_NAME + if (field.type == TType.STRING) { + this.role_name = iprot.readString(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 2: // PRINCIPAL_NAME + if (field.type == TType.STRING) { + this.principal_name = iprot.readString(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 3: // PRINCIPAL_TYPE + if (field.type == TType.I32) { + this.principal_type = PrincipalType.findByValue(iprot.readI32()); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + validate(); + } + + public void write(TProtocol oprot) throws TException { + validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (this.role_name != null) { + oprot.writeFieldBegin(ROLE_NAME_FIELD_DESC); + oprot.writeString(this.role_name); + oprot.writeFieldEnd(); + } + if (this.principal_name != null) { + oprot.writeFieldBegin(PRINCIPAL_NAME_FIELD_DESC); + oprot.writeString(this.principal_name); + oprot.writeFieldEnd(); + } + if (this.principal_type != null) { + oprot.writeFieldBegin(PRINCIPAL_TYPE_FIELD_DESC); + oprot.writeI32(this.principal_type.getValue()); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("revoke_role_args("); + boolean first = true; + + sb.append("role_name:"); + if (this.role_name == null) { + sb.append("null"); + } else { + sb.append(this.role_name); + } + first = false; + if (!first) sb.append(", "); + sb.append("principal_name:"); + if (this.principal_name == null) { + sb.append("null"); + } else { + sb.append(this.principal_name); + } + first = false; + if (!first) sb.append(", "); + sb.append("principal_type:"); + if (this.principal_type == null) { + sb.append("null"); + } else { + sb.append(this.principal_type); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws TException { + // check for required fields + } + + } + + public static class revoke_role_result implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("revoke_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 boolean success; + private MetaException o1; + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements TFieldIdEnum { + SUCCESS((short)0, "success"), + O1((short)1, "o1"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 0: // SUCCESS + return SUCCESS; + case 1: // O1 + return O1; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __SUCCESS_ISSET_ID = 0; + private BitSet __isset_bit_vector = new BitSet(1); + + public static final Map<_Fields, FieldMetaData> metaDataMap; + static { + Map<_Fields, FieldMetaData> tmpMap = new EnumMap<_Fields, FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.BOOL))); + tmpMap.put(_Fields.O1, new FieldMetaData("o1", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRUCT))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + FieldMetaData.addStructMetaDataMap(revoke_role_result.class, metaDataMap); + } + + public revoke_role_result() { + } + + public revoke_role_result( + boolean success, + MetaException o1) + { + this(); + this.success = success; + setSuccessIsSet(true); + this.o1 = o1; + } + + /** + * Performs a deep copy on other. + */ + public revoke_role_result(revoke_role_result other) { + __isset_bit_vector.clear(); + __isset_bit_vector.or(other.__isset_bit_vector); + this.success = other.success; + if (other.isSetO1()) { + this.o1 = new MetaException(other.o1); + } + } + + public revoke_role_result deepCopy() { + return new revoke_role_result(this); + } + + @Override + public void clear() { + setSuccessIsSet(false); + this.success = false; + this.o1 = null; + } + + public boolean isSuccess() { + return this.success; + } + + public void setSuccess(boolean success) { + this.success = success; + setSuccessIsSet(true); + } + + public void unsetSuccess() { + __isset_bit_vector.clear(__SUCCESS_ISSET_ID); + } + + /** Returns true if field success is set (has been asigned a value) and false otherwise */ + public boolean isSetSuccess() { + return __isset_bit_vector.get(__SUCCESS_ISSET_ID); + } + + public void setSuccessIsSet(boolean value) { + __isset_bit_vector.set(__SUCCESS_ISSET_ID, value); + } + + 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 setO1IsSet(boolean value) { + if (!value) { + this.o1 = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((Boolean)value); + } + break; + + case O1: + if (value == null) { + unsetO1(); + } else { + setO1((MetaException)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return new Boolean(isSuccess()); + + case O1: + return getO1(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case SUCCESS: + return isSetSuccess(); + case O1: + return isSetO1(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof revoke_role_result) + return this.equals((revoke_role_result)that); + return false; + } + + public boolean equals(revoke_role_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; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + public int compareTo(revoke_role_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + revoke_role_result typedOther = (revoke_role_result)other; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = TBaseHelper.compareTo(this.success, typedOther.success); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetO1()).compareTo(typedOther.isSetO1()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetO1()) { + lastComparison = TBaseHelper.compareTo(this.o1, typedOther.o1); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(TProtocol iprot) throws TException { + TField field; + iprot.readStructBegin(); + while (true) + { + field = iprot.readFieldBegin(); + if (field.type == TType.STOP) { + break; + } + switch (field.id) { + case 0: // SUCCESS + if (field.type == TType.BOOL) { + this.success = iprot.readBool(); + setSuccessIsSet(true); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 1: // 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); + } + 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(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("revoke_role_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; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws TException { + // check for required fields + } + + } + + public static class list_roles_args implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("list_roles_args"); + + private static final TField PRINCIPAL_NAME_FIELD_DESC = new TField("principal_name", TType.STRING, (short)1); + private static final TField PRINCIPAL_TYPE_FIELD_DESC = new TField("principal_type", TType.I32, (short)2); + + private String principal_name; + private PrincipalType principal_type; + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements TFieldIdEnum { + PRINCIPAL_NAME((short)1, "principal_name"), + /** + * + * @see PrincipalType + */ + PRINCIPAL_TYPE((short)2, "principal_type"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // PRINCIPAL_NAME + return PRINCIPAL_NAME; + case 2: // PRINCIPAL_TYPE + return PRINCIPAL_TYPE; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + + public static final Map<_Fields, FieldMetaData> metaDataMap; + static { + Map<_Fields, FieldMetaData> tmpMap = new EnumMap<_Fields, FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.PRINCIPAL_NAME, new FieldMetaData("principal_name", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + tmpMap.put(_Fields.PRINCIPAL_TYPE, new FieldMetaData("principal_type", TFieldRequirementType.DEFAULT, + new EnumMetaData(TType.ENUM, PrincipalType.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + FieldMetaData.addStructMetaDataMap(list_roles_args.class, metaDataMap); + } + + public list_roles_args() { + } + + public list_roles_args( + String principal_name, + PrincipalType principal_type) + { + this(); + this.principal_name = principal_name; + this.principal_type = principal_type; + } + + /** + * Performs a deep copy on other. + */ + public list_roles_args(list_roles_args other) { + if (other.isSetPrincipal_name()) { + this.principal_name = other.principal_name; + } + if (other.isSetPrincipal_type()) { + this.principal_type = other.principal_type; + } + } + + public list_roles_args deepCopy() { + return new list_roles_args(this); + } + + @Override + public void clear() { + this.principal_name = null; + this.principal_type = null; + } + + 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 void setPrincipal_nameIsSet(boolean value) { + if (!value) { + this.principal_name = null; + } + } + + /** + * + * @see PrincipalType + */ + public PrincipalType getPrincipal_type() { + return this.principal_type; + } + + /** + * + * @see PrincipalType + */ + public void setPrincipal_type(PrincipalType principal_type) { + this.principal_type = principal_type; + } + + public void unsetPrincipal_type() { + this.principal_type = null; + } + + /** Returns true if field principal_type is set (has been asigned a value) and false otherwise */ + public boolean isSetPrincipal_type() { + return this.principal_type != null; + } + + public void setPrincipal_typeIsSet(boolean value) { + if (!value) { + this.principal_type = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case PRINCIPAL_NAME: + if (value == null) { + unsetPrincipal_name(); + } else { + setPrincipal_name((String)value); + } + break; + + case PRINCIPAL_TYPE: + if (value == null) { + unsetPrincipal_type(); + } else { + setPrincipal_type((PrincipalType)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case PRINCIPAL_NAME: + return getPrincipal_name(); + + case PRINCIPAL_TYPE: + return getPrincipal_type(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case PRINCIPAL_NAME: + return isSetPrincipal_name(); + case PRINCIPAL_TYPE: + return isSetPrincipal_type(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof list_roles_args) + return this.equals((list_roles_args)that); + return false; + } + + public boolean equals(list_roles_args that) { + if (that == null) + return false; + + 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.principal_name.equals(that.principal_name)) + return false; + } + + boolean this_present_principal_type = true && this.isSetPrincipal_type(); + boolean that_present_principal_type = true && that.isSetPrincipal_type(); + if (this_present_principal_type || that_present_principal_type) { + if (!(this_present_principal_type && that_present_principal_type)) + return false; + if (!this.principal_type.equals(that.principal_type)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + public int compareTo(list_roles_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + list_roles_args typedOther = (list_roles_args)other; + + lastComparison = Boolean.valueOf(isSetPrincipal_name()).compareTo(typedOther.isSetPrincipal_name()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetPrincipal_name()) { + lastComparison = TBaseHelper.compareTo(this.principal_name, typedOther.principal_name); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetPrincipal_type()).compareTo(typedOther.isSetPrincipal_type()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetPrincipal_type()) { + lastComparison = TBaseHelper.compareTo(this.principal_type, typedOther.principal_type); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(TProtocol iprot) throws TException { + TField field; + iprot.readStructBegin(); + while (true) + { + field = iprot.readFieldBegin(); + if (field.type == TType.STOP) { + break; + } + switch (field.id) { + case 1: // PRINCIPAL_NAME + if (field.type == TType.STRING) { + this.principal_name = iprot.readString(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 2: // PRINCIPAL_TYPE + if (field.type == TType.I32) { + this.principal_type = PrincipalType.findByValue(iprot.readI32()); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + validate(); + } + + public void write(TProtocol oprot) throws TException { + validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (this.principal_name != null) { + oprot.writeFieldBegin(PRINCIPAL_NAME_FIELD_DESC); + oprot.writeString(this.principal_name); + oprot.writeFieldEnd(); + } + if (this.principal_type != null) { + oprot.writeFieldBegin(PRINCIPAL_TYPE_FIELD_DESC); + oprot.writeI32(this.principal_type.getValue()); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("list_roles_args("); + boolean first = true; + + sb.append("principal_name:"); + if (this.principal_name == null) { + sb.append("null"); + } else { + sb.append(this.principal_name); + } + first = false; + if (!first) sb.append(", "); + sb.append("principal_type:"); + if (this.principal_type == null) { + sb.append("null"); + } else { + sb.append(this.principal_type); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws TException { + // check for required fields + } + + } + + public static class list_roles_result implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("list_roles_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; + private MetaException o1; + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements TFieldIdEnum { + SUCCESS((short)0, "success"), + O1((short)1, "o1"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 0: // SUCCESS + return SUCCESS; + case 1: // O1 + return O1; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + + public static final Map<_Fields, FieldMetaData> metaDataMap; + static { + Map<_Fields, FieldMetaData> tmpMap = new EnumMap<_Fields, FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, + new ListMetaData(TType.LIST, + new StructMetaData(TType.STRUCT, Role.class)))); + tmpMap.put(_Fields.O1, new FieldMetaData("o1", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRUCT))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + FieldMetaData.addStructMetaDataMap(list_roles_result.class, metaDataMap); + } + + public list_roles_result() { + } + + public list_roles_result( + List success, + MetaException o1) + { + this(); + this.success = success; + this.o1 = o1; + } + + /** + * Performs a deep copy on other. + */ + public list_roles_result(list_roles_result other) { + if (other.isSetSuccess()) { + List __this__success = new ArrayList(); + for (Role other_element : other.success) { + __this__success.add(new Role(other_element)); + } + this.success = __this__success; + } + if (other.isSetO1()) { + this.o1 = new MetaException(other.o1); + } + } + + public list_roles_result deepCopy() { + return new list_roles_result(this); + } + + @Override + public void clear() { + this.success = null; + this.o1 = null; + } + + 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(Role 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 void setSuccessIsSet(boolean value) { + if (!value) { + 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 setO1IsSet(boolean value) { + if (!value) { + this.o1 = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((List)value); + } + break; + + case O1: + if (value == null) { + unsetO1(); + } else { + setO1((MetaException)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + case O1: + return getO1(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case SUCCESS: + return isSetSuccess(); + case O1: + return isSetO1(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof list_roles_result) + return this.equals((list_roles_result)that); + return false; + } + + public boolean equals(list_roles_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 int compareTo(list_roles_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + list_roles_result typedOther = (list_roles_result)other; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = TBaseHelper.compareTo(this.success, typedOther.success); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetO1()).compareTo(typedOther.isSetO1()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetO1()) { + lastComparison = TBaseHelper.compareTo(this.o1, typedOther.o1); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(TProtocol iprot) throws TException { + TField field; + iprot.readStructBegin(); + while (true) + { + field = iprot.readFieldBegin(); + if (field.type == TType.STOP) { + break; + } + switch (field.id) { + case 0: // SUCCESS + if (field.type == TType.LIST) { + { + TList _list212 = iprot.readListBegin(); + this.success = new ArrayList(_list212.size); + for (int _i213 = 0; _i213 < _list212.size; ++_i213) + { + Role _elem214; + _elem214 = new Role(); + _elem214.read(iprot); + this.success.add(_elem214); + } + iprot.readListEnd(); + } + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 1: // 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); + } + 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 (Role _iter215 : this.success) + { + _iter215.write(oprot); + } + 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("list_roles_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 + } + + } + + public static class get_privilege_set_args implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("get_privilege_set_args"); + + private static final TField HIVE_OBJECT_FIELD_DESC = new TField("hiveObject", TType.STRUCT, (short)1); + 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 HiveObjectRef hiveObject; + private String user_name; + private List group_names; + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements TFieldIdEnum { + HIVE_OBJECT((short)1, "hiveObject"), + USER_NAME((short)2, "user_name"), + GROUP_NAMES((short)3, "group_names"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // HIVE_OBJECT + return HIVE_OBJECT; + case 2: // USER_NAME + return USER_NAME; + case 3: // GROUP_NAMES + return GROUP_NAMES; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + + public static final Map<_Fields, FieldMetaData> metaDataMap; + static { + Map<_Fields, FieldMetaData> tmpMap = new EnumMap<_Fields, FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.HIVE_OBJECT, new FieldMetaData("hiveObject", TFieldRequirementType.DEFAULT, + new StructMetaData(TType.STRUCT, HiveObjectRef.class))); + tmpMap.put(_Fields.USER_NAME, new FieldMetaData("user_name", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + tmpMap.put(_Fields.GROUP_NAMES, new FieldMetaData("group_names", TFieldRequirementType.DEFAULT, + new ListMetaData(TType.LIST, + new FieldValueMetaData(TType.STRING)))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + FieldMetaData.addStructMetaDataMap(get_privilege_set_args.class, metaDataMap); + } + + public get_privilege_set_args() { + } + + public get_privilege_set_args( + HiveObjectRef hiveObject, + String user_name, + List group_names) + { + this(); + this.hiveObject = hiveObject; + this.user_name = user_name; + this.group_names = group_names; + } + + /** + * Performs a deep copy on other. + */ + public get_privilege_set_args(get_privilege_set_args other) { + if (other.isSetHiveObject()) { + this.hiveObject = new HiveObjectRef(other.hiveObject); + } + 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; + } + } + + public get_privilege_set_args deepCopy() { + return new get_privilege_set_args(this); + } + + @Override + public void clear() { + this.hiveObject = null; + this.user_name = null; + this.group_names = null; + } + + public HiveObjectRef getHiveObject() { + return this.hiveObject; + } + + public void setHiveObject(HiveObjectRef hiveObject) { + this.hiveObject = hiveObject; + } + + public void unsetHiveObject() { + this.hiveObject = null; + } + + /** Returns true if field hiveObject is set (has been asigned a value) and false otherwise */ + public boolean isSetHiveObject() { + return this.hiveObject != null; + } + + public void setHiveObjectIsSet(boolean value) { + if (!value) { + this.hiveObject = 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 void setUser_nameIsSet(boolean value) { + if (!value) { + 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 setGroup_namesIsSet(boolean value) { + if (!value) { + this.group_names = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case HIVE_OBJECT: + if (value == null) { + unsetHiveObject(); + } else { + setHiveObject((HiveObjectRef)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; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case HIVE_OBJECT: + return getHiveObject(); + + case USER_NAME: + return getUser_name(); + + case GROUP_NAMES: + return getGroup_names(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case HIVE_OBJECT: + return isSetHiveObject(); + case USER_NAME: + return isSetUser_name(); + case GROUP_NAMES: + return isSetGroup_names(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof get_privilege_set_args) + return this.equals((get_privilege_set_args)that); + return false; + } + + public boolean equals(get_privilege_set_args that) { + if (that == null) + return false; + + boolean this_present_hiveObject = true && this.isSetHiveObject(); + boolean that_present_hiveObject = true && that.isSetHiveObject(); + if (this_present_hiveObject || that_present_hiveObject) { + if (!(this_present_hiveObject && that_present_hiveObject)) + return false; + if (!this.hiveObject.equals(that.hiveObject)) + 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; + } + + @Override + public int hashCode() { + return 0; + } + + public int compareTo(get_privilege_set_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + get_privilege_set_args typedOther = (get_privilege_set_args)other; + + lastComparison = Boolean.valueOf(isSetHiveObject()).compareTo(typedOther.isSetHiveObject()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetHiveObject()) { + lastComparison = TBaseHelper.compareTo(this.hiveObject, typedOther.hiveObject); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetUser_name()).compareTo(typedOther.isSetUser_name()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetUser_name()) { + lastComparison = TBaseHelper.compareTo(this.user_name, typedOther.user_name); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetGroup_names()).compareTo(typedOther.isSetGroup_names()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetGroup_names()) { + lastComparison = TBaseHelper.compareTo(this.group_names, typedOther.group_names); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(TProtocol iprot) throws TException { + TField field; + iprot.readStructBegin(); + while (true) + { + field = iprot.readFieldBegin(); + if (field.type == TType.STOP) { + break; + } + switch (field.id) { + case 1: // HIVE_OBJECT + if (field.type == TType.STRUCT) { + this.hiveObject = new HiveObjectRef(); + this.hiveObject.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 2: // USER_NAME + if (field.type == TType.STRING) { + this.user_name = iprot.readString(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 3: // GROUP_NAMES + if (field.type == TType.LIST) { + { + TList _list216 = iprot.readListBegin(); + this.group_names = new ArrayList(_list216.size); + for (int _i217 = 0; _i217 < _list216.size; ++_i217) + { + String _elem218; + _elem218 = iprot.readString(); + this.group_names.add(_elem218); + } + iprot.readListEnd(); + } + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + validate(); + } + + public void write(TProtocol oprot) throws TException { + validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (this.hiveObject != null) { + oprot.writeFieldBegin(HIVE_OBJECT_FIELD_DESC); + this.hiveObject.write(oprot); + 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 _iter219 : this.group_names) + { + oprot.writeString(_iter219); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("get_privilege_set_args("); + boolean first = true; + + sb.append("hiveObject:"); + if (this.hiveObject == null) { + sb.append("null"); + } else { + sb.append(this.hiveObject); + } + 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(); + } + + public void validate() throws TException { + // check for required fields + } + + } + + public static class get_privilege_set_result implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("get_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 PrincipalPrivilegeSet success; + private MetaException o1; + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements TFieldIdEnum { + SUCCESS((short)0, "success"), + O1((short)1, "o1"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 0: // SUCCESS + return SUCCESS; + case 1: // O1 + return O1; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + + public static final Map<_Fields, FieldMetaData> metaDataMap; + static { + Map<_Fields, FieldMetaData> tmpMap = new EnumMap<_Fields, FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, + new StructMetaData(TType.STRUCT, PrincipalPrivilegeSet.class))); + tmpMap.put(_Fields.O1, new FieldMetaData("o1", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRUCT))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + FieldMetaData.addStructMetaDataMap(get_privilege_set_result.class, metaDataMap); + } + + public get_privilege_set_result() { + } + + public get_privilege_set_result( + PrincipalPrivilegeSet success, + MetaException o1) + { + this(); + this.success = success; + this.o1 = o1; + } + + /** + * Performs a deep copy on other. + */ + public get_privilege_set_result(get_privilege_set_result other) { + if (other.isSetSuccess()) { + this.success = new PrincipalPrivilegeSet(other.success); + } + if (other.isSetO1()) { + this.o1 = new MetaException(other.o1); + } + } + + public get_privilege_set_result deepCopy() { + return new get_privilege_set_result(this); + } + + @Override + public void clear() { + this.success = null; + this.o1 = null; + } + + public PrincipalPrivilegeSet getSuccess() { + return this.success; + } + + public void setSuccess(PrincipalPrivilegeSet 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 void setSuccessIsSet(boolean value) { + if (!value) { + 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 setO1IsSet(boolean value) { + if (!value) { + this.o1 = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((PrincipalPrivilegeSet)value); + } + break; + + case O1: + if (value == null) { + unsetO1(); + } else { + setO1((MetaException)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + case O1: + return getO1(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case SUCCESS: + return isSetSuccess(); + case O1: + return isSetO1(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof get_privilege_set_result) + return this.equals((get_privilege_set_result)that); + return false; + } + + public boolean equals(get_privilege_set_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 int compareTo(get_privilege_set_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + get_privilege_set_result typedOther = (get_privilege_set_result)other; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = TBaseHelper.compareTo(this.success, typedOther.success); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetO1()).compareTo(typedOther.isSetO1()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetO1()) { + lastComparison = TBaseHelper.compareTo(this.o1, typedOther.o1); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(TProtocol iprot) throws TException { + TField field; + iprot.readStructBegin(); + while (true) + { + field = iprot.readFieldBegin(); + if (field.type == TType.STOP) { + break; + } + switch (field.id) { + case 0: // SUCCESS + if (field.type == TType.STRUCT) { + this.success = new PrincipalPrivilegeSet(); + this.success.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 1: // 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); + } + 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(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("get_privilege_set_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 + } + + } + + public static class list_privileges_args implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("list_privileges_args"); + + private static final TField PRINCIPAL_NAME_FIELD_DESC = new TField("principal_name", TType.STRING, (short)1); + private static final TField PRINCIPAL_TYPE_FIELD_DESC = new TField("principal_type", TType.I32, (short)2); + private static final TField HIVE_OBJECT_FIELD_DESC = new TField("hiveObject", TType.STRUCT, (short)3); + + private String principal_name; + private PrincipalType principal_type; + private HiveObjectRef hiveObject; + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements TFieldIdEnum { + PRINCIPAL_NAME((short)1, "principal_name"), + /** + * + * @see PrincipalType + */ + PRINCIPAL_TYPE((short)2, "principal_type"), + HIVE_OBJECT((short)3, "hiveObject"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // PRINCIPAL_NAME + return PRINCIPAL_NAME; + case 2: // PRINCIPAL_TYPE + return PRINCIPAL_TYPE; + case 3: // HIVE_OBJECT + return HIVE_OBJECT; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + + public static final Map<_Fields, FieldMetaData> metaDataMap; + static { + Map<_Fields, FieldMetaData> tmpMap = new EnumMap<_Fields, FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.PRINCIPAL_NAME, new FieldMetaData("principal_name", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + tmpMap.put(_Fields.PRINCIPAL_TYPE, new FieldMetaData("principal_type", TFieldRequirementType.DEFAULT, + new EnumMetaData(TType.ENUM, PrincipalType.class))); + tmpMap.put(_Fields.HIVE_OBJECT, new FieldMetaData("hiveObject", TFieldRequirementType.DEFAULT, + new StructMetaData(TType.STRUCT, HiveObjectRef.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + FieldMetaData.addStructMetaDataMap(list_privileges_args.class, metaDataMap); + } + + public list_privileges_args() { + } + + public list_privileges_args( + String principal_name, + PrincipalType principal_type, + HiveObjectRef hiveObject) + { + this(); + this.principal_name = principal_name; + this.principal_type = principal_type; + this.hiveObject = hiveObject; + } + + /** + * Performs a deep copy on other. + */ + public list_privileges_args(list_privileges_args other) { + if (other.isSetPrincipal_name()) { + this.principal_name = other.principal_name; + } + if (other.isSetPrincipal_type()) { + this.principal_type = other.principal_type; + } + if (other.isSetHiveObject()) { + this.hiveObject = new HiveObjectRef(other.hiveObject); + } + } + + public list_privileges_args deepCopy() { + return new list_privileges_args(this); + } + + @Override + public void clear() { + this.principal_name = null; + this.principal_type = null; + this.hiveObject = null; + } + + 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 void setPrincipal_nameIsSet(boolean value) { + if (!value) { + this.principal_name = null; + } + } + + /** + * + * @see PrincipalType + */ + public PrincipalType getPrincipal_type() { + return this.principal_type; + } + + /** + * + * @see PrincipalType + */ + public void setPrincipal_type(PrincipalType principal_type) { + this.principal_type = principal_type; + } + + public void unsetPrincipal_type() { + this.principal_type = null; + } + + /** Returns true if field principal_type is set (has been asigned a value) and false otherwise */ + public boolean isSetPrincipal_type() { + return this.principal_type != null; + } + + public void setPrincipal_typeIsSet(boolean value) { + if (!value) { + this.principal_type = null; + } + } + + public HiveObjectRef getHiveObject() { + return this.hiveObject; + } + + public void setHiveObject(HiveObjectRef hiveObject) { + this.hiveObject = hiveObject; + } + + public void unsetHiveObject() { + this.hiveObject = null; + } + + /** Returns true if field hiveObject is set (has been asigned a value) and false otherwise */ + public boolean isSetHiveObject() { + return this.hiveObject != null; + } + + public void setHiveObjectIsSet(boolean value) { + if (!value) { + this.hiveObject = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case PRINCIPAL_NAME: + if (value == null) { + unsetPrincipal_name(); + } else { + setPrincipal_name((String)value); + } + break; + + case PRINCIPAL_TYPE: + if (value == null) { + unsetPrincipal_type(); + } else { + setPrincipal_type((PrincipalType)value); + } + break; + + case HIVE_OBJECT: + if (value == null) { + unsetHiveObject(); + } else { + setHiveObject((HiveObjectRef)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case PRINCIPAL_NAME: + return getPrincipal_name(); + + case PRINCIPAL_TYPE: + return getPrincipal_type(); + + case HIVE_OBJECT: + return getHiveObject(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case PRINCIPAL_NAME: + return isSetPrincipal_name(); + case PRINCIPAL_TYPE: + return isSetPrincipal_type(); + case HIVE_OBJECT: + return isSetHiveObject(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof list_privileges_args) + return this.equals((list_privileges_args)that); + return false; + } + + public boolean equals(list_privileges_args that) { + if (that == null) + return false; + + 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.principal_name.equals(that.principal_name)) + return false; + } + + boolean this_present_principal_type = true && this.isSetPrincipal_type(); + boolean that_present_principal_type = true && that.isSetPrincipal_type(); + if (this_present_principal_type || that_present_principal_type) { + if (!(this_present_principal_type && that_present_principal_type)) + return false; + if (!this.principal_type.equals(that.principal_type)) + return false; + } + + boolean this_present_hiveObject = true && this.isSetHiveObject(); + boolean that_present_hiveObject = true && that.isSetHiveObject(); + if (this_present_hiveObject || that_present_hiveObject) { + if (!(this_present_hiveObject && that_present_hiveObject)) + return false; + if (!this.hiveObject.equals(that.hiveObject)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + public int compareTo(list_privileges_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + list_privileges_args typedOther = (list_privileges_args)other; + + lastComparison = Boolean.valueOf(isSetPrincipal_name()).compareTo(typedOther.isSetPrincipal_name()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetPrincipal_name()) { + lastComparison = TBaseHelper.compareTo(this.principal_name, typedOther.principal_name); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetPrincipal_type()).compareTo(typedOther.isSetPrincipal_type()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetPrincipal_type()) { + lastComparison = TBaseHelper.compareTo(this.principal_type, typedOther.principal_type); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetHiveObject()).compareTo(typedOther.isSetHiveObject()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetHiveObject()) { + lastComparison = TBaseHelper.compareTo(this.hiveObject, typedOther.hiveObject); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(TProtocol iprot) throws TException { + TField field; + iprot.readStructBegin(); + while (true) + { + field = iprot.readFieldBegin(); + if (field.type == TType.STOP) { + break; + } + switch (field.id) { + case 1: // PRINCIPAL_NAME + if (field.type == TType.STRING) { + this.principal_name = iprot.readString(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 2: // PRINCIPAL_TYPE + if (field.type == TType.I32) { + this.principal_type = PrincipalType.findByValue(iprot.readI32()); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 3: // HIVE_OBJECT + if (field.type == TType.STRUCT) { + this.hiveObject = new HiveObjectRef(); + this.hiveObject.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + validate(); + } + + public void write(TProtocol oprot) throws TException { + validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (this.principal_name != null) { + oprot.writeFieldBegin(PRINCIPAL_NAME_FIELD_DESC); + oprot.writeString(this.principal_name); + oprot.writeFieldEnd(); + } + if (this.principal_type != null) { + oprot.writeFieldBegin(PRINCIPAL_TYPE_FIELD_DESC); + oprot.writeI32(this.principal_type.getValue()); + oprot.writeFieldEnd(); + } + if (this.hiveObject != null) { + oprot.writeFieldBegin(HIVE_OBJECT_FIELD_DESC); + this.hiveObject.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("list_privileges_args("); + boolean first = true; + + sb.append("principal_name:"); + if (this.principal_name == null) { + sb.append("null"); + } else { + sb.append(this.principal_name); + } + first = false; + if (!first) sb.append(", "); + sb.append("principal_type:"); + if (this.principal_type == null) { + sb.append("null"); + } else { + sb.append(this.principal_type); + } + first = false; + if (!first) sb.append(", "); + sb.append("hiveObject:"); + if (this.hiveObject == null) { + sb.append("null"); + } else { + sb.append(this.hiveObject); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws TException { + // check for required fields + } + + } + + public static class list_privileges_result implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("list_privileges_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; + private MetaException o1; + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements TFieldIdEnum { + SUCCESS((short)0, "success"), + O1((short)1, "o1"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 0: // SUCCESS + return SUCCESS; + case 1: // O1 + return O1; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments public static final Map<_Fields, FieldMetaData> metaDataMap; static { Map<_Fields, FieldMetaData> tmpMap = new EnumMap<_Fields, FieldMetaData>(_Fields.class); tmpMap.put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.BOOL))); + new ListMetaData(TType.LIST, + new StructMetaData(TType.STRUCT, HiveObjectPrivilege.class)))); tmpMap.put(_Fields.O1, new FieldMetaData("o1", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRUCT))); metaDataMap = Collections.unmodifiableMap(tmpMap); - FieldMetaData.addStructMetaDataMap(grant_role_result.class, metaDataMap); + FieldMetaData.addStructMetaDataMap(list_privileges_result.class, metaDataMap); } - public grant_role_result() { + public list_privileges_result() { } - public grant_role_result( - boolean success, + public list_privileges_result( + List success, MetaException o1) { this(); this.success = success; - setSuccessIsSet(true); this.o1 = o1; } /** * Performs a deep copy on other. */ - public grant_role_result(grant_role_result other) { - __isset_bit_vector.clear(); - __isset_bit_vector.or(other.__isset_bit_vector); - this.success = other.success; + public list_privileges_result(list_privileges_result other) { + if (other.isSetSuccess()) { + List __this__success = new ArrayList(); + for (HiveObjectPrivilege other_element : other.success) { + __this__success.add(new HiveObjectPrivilege(other_element)); + } + this.success = __this__success; + } if (other.isSetO1()) { this.o1 = new MetaException(other.o1); } } - public grant_role_result deepCopy() { - return new grant_role_result(this); + public list_privileges_result deepCopy() { + return new list_privileges_result(this); } @Override public void clear() { - setSuccessIsSet(false); - this.success = false; + this.success = null; this.o1 = null; } - 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(HiveObjectPrivilege 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; - setSuccessIsSet(true); } public void unsetSuccess() { - __isset_bit_vector.clear(__SUCCESS_ISSET_ID); + this.success = null; } /** Returns true if field success is set (has been asigned a value) and false otherwise */ public boolean isSetSuccess() { - return __isset_bit_vector.get(__SUCCESS_ISSET_ID); + return this.success != null; } public void setSuccessIsSet(boolean value) { - __isset_bit_vector.set(__SUCCESS_ISSET_ID, value); + if (!value) { + this.success = null; + } } public MetaException getO1() { @@ -46125,7 +49898,7 @@ public class ThriftHiveMetastore { if (value == null) { unsetSuccess(); } else { - setSuccess((Boolean)value); + setSuccess((List)value); } break; @@ -46143,7 +49916,7 @@ public class ThriftHiveMetastore { public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: - return new Boolean(isSuccess()); + return getSuccess(); case O1: return getO1(); @@ -46171,21 +49944,21 @@ public class ThriftHiveMetastore { public boolean equals(Object that) { if (that == null) return false; - if (that instanceof grant_role_result) - return this.equals((grant_role_result)that); + if (that instanceof list_privileges_result) + return this.equals((list_privileges_result)that); return false; } - public boolean equals(grant_role_result that) { + public boolean equals(list_privileges_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; } @@ -46206,13 +49979,13 @@ public class ThriftHiveMetastore { return 0; } - public int compareTo(grant_role_result other) { + public int compareTo(list_privileges_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; - grant_role_result typedOther = (grant_role_result)other; + list_privileges_result typedOther = (list_privileges_result)other; lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess()); if (lastComparison != 0) { @@ -46252,9 +50025,19 @@ public class ThriftHiveMetastore { } switch (field.id) { case 0: // SUCCESS - if (field.type == TType.BOOL) { - this.success = iprot.readBool(); - setSuccessIsSet(true); + if (field.type == TType.LIST) { + { + TList _list220 = iprot.readListBegin(); + this.success = new ArrayList(_list220.size); + for (int _i221 = 0; _i221 < _list220.size; ++_i221) + { + HiveObjectPrivilege _elem222; + _elem222 = new HiveObjectPrivilege(); + _elem222.read(iprot); + this.success.add(_elem222); + } + iprot.readListEnd(); + } } else { TProtocolUtil.skip(iprot, field.type); } @@ -46281,7 +50064,14 @@ public class ThriftHiveMetastore { if (this.isSetSuccess()) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - oprot.writeBool(this.success); + { + oprot.writeListBegin(new TList(TType.STRUCT, this.success.size())); + for (HiveObjectPrivilege _iter223 : this.success) + { + _iter223.write(oprot); + } + oprot.writeListEnd(); + } oprot.writeFieldEnd(); } else if (this.isSetO1()) { oprot.writeFieldBegin(O1_FIELD_DESC); @@ -46294,11 +50084,15 @@ public class ThriftHiveMetastore { @Override public String toString() { - StringBuilder sb = new StringBuilder("grant_role_result("); + StringBuilder sb = new StringBuilder("list_privileges_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:"); @@ -46318,26 +50112,16 @@ public class ThriftHiveMetastore { } - public static class revoke_role_args implements TBase, java.io.Serializable, Cloneable { - private static final TStruct STRUCT_DESC = new TStruct("revoke_role_args"); + 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 ROLE_NAME_FIELD_DESC = new TField("role_name", TType.STRING, (short)1); - private static final TField PRINCIPAL_NAME_FIELD_DESC = new TField("principal_name", TType.STRING, (short)2); - private static final TField PRINCIPAL_TYPE_FIELD_DESC = new TField("principal_type", TType.I32, (short)3); + private static final TField PRIVILEGES_FIELD_DESC = new TField("privileges", TType.STRUCT, (short)1); - private String role_name; - private String principal_name; - private PrincipalType principal_type; + private PrivilegeBag privileges; /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements TFieldIdEnum { - ROLE_NAME((short)1, "role_name"), - PRINCIPAL_NAME((short)2, "principal_name"), - /** - * - * @see PrincipalType - */ - PRINCIPAL_TYPE((short)3, "principal_type"); + PRIVILEGES((short)1, "privileges"); private static final Map byName = new HashMap(); @@ -46352,12 +50136,8 @@ public class ThriftHiveMetastore { */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { - case 1: // ROLE_NAME - return ROLE_NAME; - case 2: // PRINCIPAL_NAME - return PRINCIPAL_NAME; - case 3: // PRINCIPAL_TYPE - return PRINCIPAL_TYPE; + case 1: // PRIVILEGES + return PRIVILEGES; default: return null; } @@ -46402,156 +50182,70 @@ public class ThriftHiveMetastore { public static final Map<_Fields, FieldMetaData> metaDataMap; static { Map<_Fields, FieldMetaData> tmpMap = new EnumMap<_Fields, FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.ROLE_NAME, new FieldMetaData("role_name", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRING))); - tmpMap.put(_Fields.PRINCIPAL_NAME, new FieldMetaData("principal_name", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRING))); - tmpMap.put(_Fields.PRINCIPAL_TYPE, new FieldMetaData("principal_type", TFieldRequirementType.DEFAULT, - new EnumMetaData(TType.ENUM, PrincipalType.class))); + tmpMap.put(_Fields.PRIVILEGES, new FieldMetaData("privileges", TFieldRequirementType.DEFAULT, + new StructMetaData(TType.STRUCT, PrivilegeBag.class))); metaDataMap = Collections.unmodifiableMap(tmpMap); - FieldMetaData.addStructMetaDataMap(revoke_role_args.class, metaDataMap); + FieldMetaData.addStructMetaDataMap(grant_privileges_args.class, metaDataMap); } - public revoke_role_args() { + public grant_privileges_args() { } - public revoke_role_args( - String role_name, - String principal_name, - PrincipalType principal_type) + public grant_privileges_args( + PrivilegeBag privileges) { this(); - this.role_name = role_name; - this.principal_name = principal_name; - this.principal_type = principal_type; + this.privileges = privileges; } /** * Performs a deep copy on other. */ - public revoke_role_args(revoke_role_args other) { - if (other.isSetRole_name()) { - this.role_name = other.role_name; - } - if (other.isSetPrincipal_name()) { - this.principal_name = other.principal_name; - } - if (other.isSetPrincipal_type()) { - this.principal_type = other.principal_type; + public grant_privileges_args(grant_privileges_args other) { + if (other.isSetPrivileges()) { + this.privileges = new PrivilegeBag(other.privileges); } } - public revoke_role_args deepCopy() { - return new revoke_role_args(this); + public grant_privileges_args deepCopy() { + return new grant_privileges_args(this); } @Override public void clear() { - this.role_name = null; - this.principal_name = null; - this.principal_type = null; - } - - public String getRole_name() { - return this.role_name; - } - - public void setRole_name(String role_name) { - this.role_name = role_name; - } - - public void unsetRole_name() { - this.role_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 void setRole_nameIsSet(boolean value) { - if (!value) { - this.role_name = null; - } - } - - 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 void setPrincipal_nameIsSet(boolean value) { - if (!value) { - this.principal_name = null; - } + this.privileges = null; } - /** - * - * @see PrincipalType - */ - public PrincipalType getPrincipal_type() { - return this.principal_type; + public PrivilegeBag getPrivileges() { + return this.privileges; } - /** - * - * @see PrincipalType - */ - public void setPrincipal_type(PrincipalType principal_type) { - this.principal_type = principal_type; + public void setPrivileges(PrivilegeBag privileges) { + this.privileges = privileges; } - public void unsetPrincipal_type() { - this.principal_type = null; + public void unsetPrivileges() { + this.privileges = null; } - /** Returns true if field principal_type is set (has been asigned a value) and false otherwise */ - public boolean isSetPrincipal_type() { - return this.principal_type != 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 setPrincipal_typeIsSet(boolean value) { + public void setPrivilegesIsSet(boolean value) { if (!value) { - this.principal_type = null; + this.privileges = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { - case ROLE_NAME: - if (value == null) { - unsetRole_name(); - } else { - setRole_name((String)value); - } - break; - - case PRINCIPAL_NAME: - if (value == null) { - unsetPrincipal_name(); - } else { - setPrincipal_name((String)value); - } - break; - - case PRINCIPAL_TYPE: + case PRIVILEGES: if (value == null) { - unsetPrincipal_type(); + unsetPrivileges(); } else { - setPrincipal_type((PrincipalType)value); + setPrivileges((PrivilegeBag)value); } break; @@ -46560,14 +50254,8 @@ public class ThriftHiveMetastore { public Object getFieldValue(_Fields field) { switch (field) { - case ROLE_NAME: - return getRole_name(); - - case PRINCIPAL_NAME: - return getPrincipal_name(); - - case PRINCIPAL_TYPE: - return getPrincipal_type(); + case PRIVILEGES: + return getPrivileges(); } throw new IllegalStateException(); @@ -46580,12 +50268,8 @@ public class ThriftHiveMetastore { } switch (field) { - case ROLE_NAME: - return isSetRole_name(); - case PRINCIPAL_NAME: - return isSetPrincipal_name(); - case PRINCIPAL_TYPE: - return isSetPrincipal_type(); + case PRIVILEGES: + return isSetPrivileges(); } throw new IllegalStateException(); } @@ -46594,39 +50278,21 @@ public class ThriftHiveMetastore { public boolean equals(Object that) { if (that == null) return false; - if (that instanceof revoke_role_args) - return this.equals((revoke_role_args)that); + if (that instanceof grant_privileges_args) + return this.equals((grant_privileges_args)that); return false; } - public boolean equals(revoke_role_args that) { + public boolean equals(grant_privileges_args that) { if (that == null) return false; - 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.role_name.equals(that.role_name)) - return false; - } - - 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.principal_name.equals(that.principal_name)) - return false; - } - - boolean this_present_principal_type = true && this.isSetPrincipal_type(); - boolean that_present_principal_type = true && that.isSetPrincipal_type(); - if (this_present_principal_type || that_present_principal_type) { - if (!(this_present_principal_type && that_present_principal_type)) + 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.principal_type.equals(that.principal_type)) + if (!this.privileges.equals(that.privileges)) return false; } @@ -46638,40 +50304,20 @@ public class ThriftHiveMetastore { return 0; } - public int compareTo(revoke_role_args other) { + public int compareTo(grant_privileges_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; - revoke_role_args typedOther = (revoke_role_args)other; + grant_privileges_args typedOther = (grant_privileges_args)other; - lastComparison = Boolean.valueOf(isSetRole_name()).compareTo(typedOther.isSetRole_name()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetRole_name()) { - lastComparison = TBaseHelper.compareTo(this.role_name, typedOther.role_name); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetPrincipal_name()).compareTo(typedOther.isSetPrincipal_name()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetPrincipal_name()) { - lastComparison = TBaseHelper.compareTo(this.principal_name, typedOther.principal_name); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetPrincipal_type()).compareTo(typedOther.isSetPrincipal_type()); + lastComparison = Boolean.valueOf(isSetPrivileges()).compareTo(typedOther.isSetPrivileges()); if (lastComparison != 0) { return lastComparison; } - if (isSetPrincipal_type()) { - lastComparison = TBaseHelper.compareTo(this.principal_type, typedOther.principal_type); + if (isSetPrivileges()) { + lastComparison = TBaseHelper.compareTo(this.privileges, typedOther.privileges); if (lastComparison != 0) { return lastComparison; } @@ -46693,23 +50339,10 @@ public class ThriftHiveMetastore { break; } switch (field.id) { - case 1: // ROLE_NAME - if (field.type == TType.STRING) { - this.role_name = iprot.readString(); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // PRINCIPAL_NAME - if (field.type == TType.STRING) { - this.principal_name = iprot.readString(); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - case 3: // PRINCIPAL_TYPE - if (field.type == TType.I32) { - this.principal_type = PrincipalType.findByValue(iprot.readI32()); + case 1: // PRIVILEGES + if (field.type == TType.STRUCT) { + this.privileges = new PrivilegeBag(); + this.privileges.read(iprot); } else { TProtocolUtil.skip(iprot, field.type); } @@ -46727,19 +50360,9 @@ public class ThriftHiveMetastore { validate(); oprot.writeStructBegin(STRUCT_DESC); - if (this.role_name != null) { - oprot.writeFieldBegin(ROLE_NAME_FIELD_DESC); - oprot.writeString(this.role_name); - oprot.writeFieldEnd(); - } - if (this.principal_name != null) { - oprot.writeFieldBegin(PRINCIPAL_NAME_FIELD_DESC); - oprot.writeString(this.principal_name); - oprot.writeFieldEnd(); - } - if (this.principal_type != null) { - oprot.writeFieldBegin(PRINCIPAL_TYPE_FIELD_DESC); - oprot.writeI32(this.principal_type.getValue()); + if (this.privileges != null) { + oprot.writeFieldBegin(PRIVILEGES_FIELD_DESC); + this.privileges.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); @@ -46748,30 +50371,14 @@ public class ThriftHiveMetastore { @Override public String toString() { - StringBuilder sb = new StringBuilder("revoke_role_args("); + StringBuilder sb = new StringBuilder("grant_privileges_args("); boolean first = true; - sb.append("role_name:"); - if (this.role_name == null) { - sb.append("null"); - } else { - sb.append(this.role_name); - } - first = false; - if (!first) sb.append(", "); - sb.append("principal_name:"); - if (this.principal_name == null) { - sb.append("null"); - } else { - sb.append(this.principal_name); - } - first = false; - if (!first) sb.append(", "); - sb.append("principal_type:"); - if (this.principal_type == null) { + sb.append("privileges:"); + if (this.privileges == null) { sb.append("null"); } else { - sb.append(this.principal_type); + sb.append(this.privileges); } first = false; sb.append(")"); @@ -46784,8 +50391,8 @@ public class ThriftHiveMetastore { } - public static class revoke_role_result implements TBase, java.io.Serializable, Cloneable { - private static final TStruct STRUCT_DESC = new TStruct("revoke_role_result"); + 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); @@ -46866,13 +50473,13 @@ public class ThriftHiveMetastore { tmpMap.put(_Fields.O1, new FieldMetaData("o1", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRUCT))); metaDataMap = Collections.unmodifiableMap(tmpMap); - FieldMetaData.addStructMetaDataMap(revoke_role_result.class, metaDataMap); + FieldMetaData.addStructMetaDataMap(grant_privileges_result.class, metaDataMap); } - public revoke_role_result() { + public grant_privileges_result() { } - public revoke_role_result( + public grant_privileges_result( boolean success, MetaException o1) { @@ -46885,7 +50492,7 @@ public class ThriftHiveMetastore { /** * Performs a deep copy on other. */ - public revoke_role_result(revoke_role_result other) { + public grant_privileges_result(grant_privileges_result other) { __isset_bit_vector.clear(); __isset_bit_vector.or(other.__isset_bit_vector); this.success = other.success; @@ -46894,8 +50501,8 @@ public class ThriftHiveMetastore { } } - public revoke_role_result deepCopy() { - return new revoke_role_result(this); + public grant_privileges_result deepCopy() { + return new grant_privileges_result(this); } @Override @@ -47002,12 +50609,12 @@ public class ThriftHiveMetastore { public boolean equals(Object that) { if (that == null) return false; - if (that instanceof revoke_role_result) - return this.equals((revoke_role_result)that); + if (that instanceof grant_privileges_result) + return this.equals((grant_privileges_result)that); return false; } - public boolean equals(revoke_role_result that) { + public boolean equals(grant_privileges_result that) { if (that == null) return false; @@ -47037,13 +50644,13 @@ public class ThriftHiveMetastore { return 0; } - public int compareTo(revoke_role_result other) { + public int compareTo(grant_privileges_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; - revoke_role_result typedOther = (revoke_role_result)other; + grant_privileges_result typedOther = (grant_privileges_result)other; lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess()); if (lastComparison != 0) { @@ -47125,7 +50732,7 @@ public class ThriftHiveMetastore { @Override public String toString() { - StringBuilder sb = new StringBuilder("revoke_role_result("); + StringBuilder sb = new StringBuilder("grant_privileges_result("); boolean first = true; sb.append("success:"); @@ -47149,23 +50756,16 @@ public class ThriftHiveMetastore { } - public static class list_roles_args implements TBase, java.io.Serializable, Cloneable { - private static final TStruct STRUCT_DESC = new TStruct("list_roles_args"); + 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 PRINCIPAL_NAME_FIELD_DESC = new TField("principal_name", TType.STRING, (short)1); - private static final TField PRINCIPAL_TYPE_FIELD_DESC = new TField("principal_type", TType.I32, (short)2); + private static final TField PRIVILEGES_FIELD_DESC = new TField("privileges", TType.STRUCT, (short)1); - private String principal_name; - private PrincipalType principal_type; + private PrivilegeBag privileges; /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements TFieldIdEnum { - PRINCIPAL_NAME((short)1, "principal_name"), - /** - * - * @see PrincipalType - */ - PRINCIPAL_TYPE((short)2, "principal_type"); + PRIVILEGES((short)1, "privileges"); private static final Map byName = new HashMap(); @@ -47180,10 +50780,8 @@ public class ThriftHiveMetastore { */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { - case 1: // PRINCIPAL_NAME - return PRINCIPAL_NAME; - case 2: // PRINCIPAL_TYPE - return PRINCIPAL_TYPE; + case 1: // PRIVILEGES + return PRIVILEGES; default: return null; } @@ -47228,117 +50826,70 @@ public class ThriftHiveMetastore { public static final Map<_Fields, FieldMetaData> metaDataMap; static { Map<_Fields, FieldMetaData> tmpMap = new EnumMap<_Fields, FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.PRINCIPAL_NAME, new FieldMetaData("principal_name", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRING))); - tmpMap.put(_Fields.PRINCIPAL_TYPE, new FieldMetaData("principal_type", TFieldRequirementType.DEFAULT, - new EnumMetaData(TType.ENUM, PrincipalType.class))); + tmpMap.put(_Fields.PRIVILEGES, new FieldMetaData("privileges", TFieldRequirementType.DEFAULT, + new StructMetaData(TType.STRUCT, PrivilegeBag.class))); metaDataMap = Collections.unmodifiableMap(tmpMap); - FieldMetaData.addStructMetaDataMap(list_roles_args.class, metaDataMap); + FieldMetaData.addStructMetaDataMap(revoke_privileges_args.class, metaDataMap); } - public list_roles_args() { + public revoke_privileges_args() { } - public list_roles_args( - String principal_name, - PrincipalType principal_type) + public revoke_privileges_args( + PrivilegeBag privileges) { this(); - this.principal_name = principal_name; - this.principal_type = principal_type; + this.privileges = privileges; } /** * Performs a deep copy on other. */ - public list_roles_args(list_roles_args other) { - if (other.isSetPrincipal_name()) { - this.principal_name = other.principal_name; - } - if (other.isSetPrincipal_type()) { - this.principal_type = other.principal_type; + public revoke_privileges_args(revoke_privileges_args other) { + if (other.isSetPrivileges()) { + this.privileges = new PrivilegeBag(other.privileges); } } - public list_roles_args deepCopy() { - return new list_roles_args(this); + public revoke_privileges_args deepCopy() { + return new revoke_privileges_args(this); } @Override public void clear() { - this.principal_name = null; - this.principal_type = null; - } - - 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 void setPrincipal_nameIsSet(boolean value) { - if (!value) { - this.principal_name = null; - } + this.privileges = null; } - /** - * - * @see PrincipalType - */ - public PrincipalType getPrincipal_type() { - return this.principal_type; + public PrivilegeBag getPrivileges() { + return this.privileges; } - /** - * - * @see PrincipalType - */ - public void setPrincipal_type(PrincipalType principal_type) { - this.principal_type = principal_type; + public void setPrivileges(PrivilegeBag privileges) { + this.privileges = privileges; } - public void unsetPrincipal_type() { - this.principal_type = null; + public void unsetPrivileges() { + this.privileges = null; } - /** Returns true if field principal_type is set (has been asigned a value) and false otherwise */ - public boolean isSetPrincipal_type() { - return this.principal_type != 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 setPrincipal_typeIsSet(boolean value) { + public void setPrivilegesIsSet(boolean value) { if (!value) { - this.principal_type = null; + this.privileges = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { - case PRINCIPAL_NAME: - if (value == null) { - unsetPrincipal_name(); - } else { - setPrincipal_name((String)value); - } - break; - - case PRINCIPAL_TYPE: + case PRIVILEGES: if (value == null) { - unsetPrincipal_type(); + unsetPrivileges(); } else { - setPrincipal_type((PrincipalType)value); + setPrivileges((PrivilegeBag)value); } break; @@ -47347,11 +50898,8 @@ public class ThriftHiveMetastore { public Object getFieldValue(_Fields field) { switch (field) { - case PRINCIPAL_NAME: - return getPrincipal_name(); - - case PRINCIPAL_TYPE: - return getPrincipal_type(); + case PRIVILEGES: + return getPrivileges(); } throw new IllegalStateException(); @@ -47364,10 +50912,8 @@ public class ThriftHiveMetastore { } switch (field) { - case PRINCIPAL_NAME: - return isSetPrincipal_name(); - case PRINCIPAL_TYPE: - return isSetPrincipal_type(); + case PRIVILEGES: + return isSetPrivileges(); } throw new IllegalStateException(); } @@ -47376,30 +50922,21 @@ public class ThriftHiveMetastore { public boolean equals(Object that) { if (that == null) return false; - if (that instanceof list_roles_args) - return this.equals((list_roles_args)that); + if (that instanceof revoke_privileges_args) + return this.equals((revoke_privileges_args)that); return false; } - public boolean equals(list_roles_args that) { + public boolean equals(revoke_privileges_args that) { if (that == null) return false; - 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.principal_name.equals(that.principal_name)) - return false; - } - - boolean this_present_principal_type = true && this.isSetPrincipal_type(); - boolean that_present_principal_type = true && that.isSetPrincipal_type(); - if (this_present_principal_type || that_present_principal_type) { - if (!(this_present_principal_type && that_present_principal_type)) + 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.principal_type.equals(that.principal_type)) + if (!this.privileges.equals(that.privileges)) return false; } @@ -47411,30 +50948,20 @@ public class ThriftHiveMetastore { return 0; } - public int compareTo(list_roles_args other) { + public int compareTo(revoke_privileges_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; - list_roles_args typedOther = (list_roles_args)other; + revoke_privileges_args typedOther = (revoke_privileges_args)other; - lastComparison = Boolean.valueOf(isSetPrincipal_name()).compareTo(typedOther.isSetPrincipal_name()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetPrincipal_name()) { - lastComparison = TBaseHelper.compareTo(this.principal_name, typedOther.principal_name); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetPrincipal_type()).compareTo(typedOther.isSetPrincipal_type()); + lastComparison = Boolean.valueOf(isSetPrivileges()).compareTo(typedOther.isSetPrivileges()); if (lastComparison != 0) { return lastComparison; } - if (isSetPrincipal_type()) { - lastComparison = TBaseHelper.compareTo(this.principal_type, typedOther.principal_type); + if (isSetPrivileges()) { + lastComparison = TBaseHelper.compareTo(this.privileges, typedOther.privileges); if (lastComparison != 0) { return lastComparison; } @@ -47456,16 +50983,10 @@ public class ThriftHiveMetastore { break; } switch (field.id) { - case 1: // PRINCIPAL_NAME - if (field.type == TType.STRING) { - this.principal_name = iprot.readString(); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // PRINCIPAL_TYPE - if (field.type == TType.I32) { - this.principal_type = PrincipalType.findByValue(iprot.readI32()); + case 1: // PRIVILEGES + if (field.type == TType.STRUCT) { + this.privileges = new PrivilegeBag(); + this.privileges.read(iprot); } else { TProtocolUtil.skip(iprot, field.type); } @@ -47483,14 +51004,9 @@ public class ThriftHiveMetastore { validate(); oprot.writeStructBegin(STRUCT_DESC); - if (this.principal_name != null) { - oprot.writeFieldBegin(PRINCIPAL_NAME_FIELD_DESC); - oprot.writeString(this.principal_name); - oprot.writeFieldEnd(); - } - if (this.principal_type != null) { - oprot.writeFieldBegin(PRINCIPAL_TYPE_FIELD_DESC); - oprot.writeI32(this.principal_type.getValue()); + if (this.privileges != null) { + oprot.writeFieldBegin(PRIVILEGES_FIELD_DESC); + this.privileges.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); @@ -47499,22 +51015,14 @@ public class ThriftHiveMetastore { @Override public String toString() { - StringBuilder sb = new StringBuilder("list_roles_args("); + StringBuilder sb = new StringBuilder("revoke_privileges_args("); boolean first = true; - sb.append("principal_name:"); - if (this.principal_name == null) { - sb.append("null"); - } else { - sb.append(this.principal_name); - } - first = false; - if (!first) sb.append(", "); - sb.append("principal_type:"); - if (this.principal_type == null) { + sb.append("privileges:"); + if (this.privileges == null) { sb.append("null"); } else { - sb.append(this.principal_type); + sb.append(this.privileges); } first = false; sb.append(")"); @@ -47527,13 +51035,13 @@ public class ThriftHiveMetastore { } - public static class list_roles_result implements TBase, java.io.Serializable, Cloneable { - private static final TStruct STRUCT_DESC = new TStruct("list_roles_result"); + 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.LIST, (short)0); + 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; private MetaException o1; /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ @@ -47598,93 +51106,76 @@ public class ThriftHiveMetastore { } // isset id assignments + private static final int __SUCCESS_ISSET_ID = 0; + private BitSet __isset_bit_vector = new BitSet(1); public static final Map<_Fields, FieldMetaData> metaDataMap; static { Map<_Fields, FieldMetaData> tmpMap = new EnumMap<_Fields, FieldMetaData>(_Fields.class); tmpMap.put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, - new ListMetaData(TType.LIST, - new StructMetaData(TType.STRUCT, Role.class)))); + new FieldValueMetaData(TType.BOOL))); tmpMap.put(_Fields.O1, new FieldMetaData("o1", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRUCT))); metaDataMap = Collections.unmodifiableMap(tmpMap); - FieldMetaData.addStructMetaDataMap(list_roles_result.class, metaDataMap); + FieldMetaData.addStructMetaDataMap(revoke_privileges_result.class, metaDataMap); } - public list_roles_result() { + public revoke_privileges_result() { } - public list_roles_result( - List success, + public revoke_privileges_result( + boolean success, MetaException o1) { this(); this.success = success; + setSuccessIsSet(true); this.o1 = o1; } /** * Performs a deep copy on other. */ - public list_roles_result(list_roles_result other) { - if (other.isSetSuccess()) { - List __this__success = new ArrayList(); - for (Role other_element : other.success) { - __this__success.add(new Role(other_element)); - } - this.success = __this__success; - } + public revoke_privileges_result(revoke_privileges_result other) { + __isset_bit_vector.clear(); + __isset_bit_vector.or(other.__isset_bit_vector); + this.success = other.success; if (other.isSetO1()) { this.o1 = new MetaException(other.o1); } } - public list_roles_result deepCopy() { - return new list_roles_result(this); + public revoke_privileges_result deepCopy() { + return new revoke_privileges_result(this); } @Override public void clear() { - this.success = null; + setSuccessIsSet(false); + this.success = false; this.o1 = null; } - 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(Role elem) { - if (this.success == null) { - this.success = new ArrayList(); - } - this.success.add(elem); - } - - public List getSuccess() { + public boolean isSuccess() { return this.success; } - public void setSuccess(List success) { + public void setSuccess(boolean success) { this.success = success; + setSuccessIsSet(true); } public void unsetSuccess() { - this.success = null; + __isset_bit_vector.clear(__SUCCESS_ISSET_ID); } /** Returns true if field success is set (has been asigned a value) and false otherwise */ public boolean isSetSuccess() { - return this.success != null; + return __isset_bit_vector.get(__SUCCESS_ISSET_ID); } public void setSuccessIsSet(boolean value) { - if (!value) { - this.success = null; - } + __isset_bit_vector.set(__SUCCESS_ISSET_ID, value); } public MetaException getO1() { @@ -47716,7 +51207,7 @@ public class ThriftHiveMetastore { if (value == null) { unsetSuccess(); } else { - setSuccess((List)value); + setSuccess((Boolean)value); } break; @@ -47734,7 +51225,7 @@ public class ThriftHiveMetastore { public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: - return getSuccess(); + return new Boolean(isSuccess()); case O1: return getO1(); @@ -47762,21 +51253,21 @@ public class ThriftHiveMetastore { public boolean equals(Object that) { if (that == null) return false; - if (that instanceof list_roles_result) - return this.equals((list_roles_result)that); + if (that instanceof revoke_privileges_result) + return this.equals((revoke_privileges_result)that); return false; } - public boolean equals(list_roles_result that) { + public boolean equals(revoke_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; } @@ -47797,13 +51288,13 @@ public class ThriftHiveMetastore { return 0; } - public int compareTo(list_roles_result other) { + public int compareTo(revoke_privileges_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; - list_roles_result typedOther = (list_roles_result)other; + revoke_privileges_result typedOther = (revoke_privileges_result)other; lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess()); if (lastComparison != 0) { @@ -47843,19 +51334,9 @@ public class ThriftHiveMetastore { } switch (field.id) { case 0: // SUCCESS - if (field.type == TType.LIST) { - { - TList _list212 = iprot.readListBegin(); - this.success = new ArrayList(_list212.size); - for (int _i213 = 0; _i213 < _list212.size; ++_i213) - { - Role _elem214; - _elem214 = new Role(); - _elem214.read(iprot); - this.success.add(_elem214); - } - iprot.readListEnd(); - } + if (field.type == TType.BOOL) { + this.success = iprot.readBool(); + setSuccessIsSet(true); } else { TProtocolUtil.skip(iprot, field.type); } @@ -47882,14 +51363,7 @@ public class ThriftHiveMetastore { if (this.isSetSuccess()) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - { - oprot.writeListBegin(new TList(TType.STRUCT, this.success.size())); - for (Role _iter215 : this.success) - { - _iter215.write(oprot); - } - oprot.writeListEnd(); - } + oprot.writeBool(this.success); oprot.writeFieldEnd(); } else if (this.isSetO1()) { oprot.writeFieldBegin(O1_FIELD_DESC); @@ -47902,15 +51376,11 @@ public class ThriftHiveMetastore { @Override public String toString() { - StringBuilder sb = new StringBuilder("list_roles_result("); + StringBuilder sb = new StringBuilder("revoke_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("o1:"); @@ -47930,22 +51400,16 @@ public class ThriftHiveMetastore { } - public static class get_privilege_set_args implements TBase, java.io.Serializable, Cloneable { - private static final TStruct STRUCT_DESC = new TStruct("get_privilege_set_args"); + public static class get_delegation_token_args implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("get_delegation_token_args"); - private static final TField HIVE_OBJECT_FIELD_DESC = new TField("hiveObject", TType.STRUCT, (short)1); - 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 static final TField RENEWER_KERBEROS_PRINCIPAL_NAME_FIELD_DESC = new TField("renewer_kerberos_principal_name", TType.STRING, (short)1); - private HiveObjectRef hiveObject; - private String user_name; - private List group_names; + private String renewer_kerberos_principal_name; /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements TFieldIdEnum { - HIVE_OBJECT((short)1, "hiveObject"), - USER_NAME((short)2, "user_name"), - GROUP_NAMES((short)3, "group_names"); + RENEWER_KERBEROS_PRINCIPAL_NAME((short)1, "renewer_kerberos_principal_name"); private static final Map byName = new HashMap(); @@ -47960,12 +51424,8 @@ public class ThriftHiveMetastore { */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { - case 1: // HIVE_OBJECT - return HIVE_OBJECT; - case 2: // USER_NAME - return USER_NAME; - case 3: // GROUP_NAMES - return GROUP_NAMES; + case 1: // RENEWER_KERBEROS_PRINCIPAL_NAME + return RENEWER_KERBEROS_PRINCIPAL_NAME; default: return null; } @@ -48010,168 +51470,70 @@ public class ThriftHiveMetastore { public static final Map<_Fields, FieldMetaData> metaDataMap; static { Map<_Fields, FieldMetaData> tmpMap = new EnumMap<_Fields, FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.HIVE_OBJECT, new FieldMetaData("hiveObject", TFieldRequirementType.DEFAULT, - new StructMetaData(TType.STRUCT, HiveObjectRef.class))); - tmpMap.put(_Fields.USER_NAME, new FieldMetaData("user_name", TFieldRequirementType.DEFAULT, + tmpMap.put(_Fields.RENEWER_KERBEROS_PRINCIPAL_NAME, new FieldMetaData("renewer_kerberos_principal_name", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRING))); - tmpMap.put(_Fields.GROUP_NAMES, new FieldMetaData("group_names", TFieldRequirementType.DEFAULT, - new ListMetaData(TType.LIST, - new FieldValueMetaData(TType.STRING)))); metaDataMap = Collections.unmodifiableMap(tmpMap); - FieldMetaData.addStructMetaDataMap(get_privilege_set_args.class, metaDataMap); + FieldMetaData.addStructMetaDataMap(get_delegation_token_args.class, metaDataMap); } - public get_privilege_set_args() { + public get_delegation_token_args() { } - public get_privilege_set_args( - HiveObjectRef hiveObject, - String user_name, - List group_names) + public get_delegation_token_args( + String renewer_kerberos_principal_name) { this(); - this.hiveObject = hiveObject; - this.user_name = user_name; - this.group_names = group_names; + this.renewer_kerberos_principal_name = renewer_kerberos_principal_name; } /** * Performs a deep copy on other. */ - public get_privilege_set_args(get_privilege_set_args other) { - if (other.isSetHiveObject()) { - this.hiveObject = new HiveObjectRef(other.hiveObject); - } - 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; + public get_delegation_token_args(get_delegation_token_args other) { + if (other.isSetRenewer_kerberos_principal_name()) { + this.renewer_kerberos_principal_name = other.renewer_kerberos_principal_name; } } - public get_privilege_set_args deepCopy() { - return new get_privilege_set_args(this); + public get_delegation_token_args deepCopy() { + return new get_delegation_token_args(this); } @Override public void clear() { - this.hiveObject = null; - this.user_name = null; - this.group_names = null; - } - - public HiveObjectRef getHiveObject() { - return this.hiveObject; - } - - public void setHiveObject(HiveObjectRef hiveObject) { - this.hiveObject = hiveObject; - } - - public void unsetHiveObject() { - this.hiveObject = null; - } - - /** Returns true if field hiveObject is set (has been asigned a value) and false otherwise */ - public boolean isSetHiveObject() { - return this.hiveObject != null; - } - - public void setHiveObjectIsSet(boolean value) { - if (!value) { - this.hiveObject = null; - } + this.renewer_kerberos_principal_name = null; } - public String getUser_name() { - return this.user_name; + public String getRenewer_kerberos_principal_name() { + return this.renewer_kerberos_principal_name; } - public void setUser_name(String user_name) { - this.user_name = user_name; + public void setRenewer_kerberos_principal_name(String renewer_kerberos_principal_name) { + this.renewer_kerberos_principal_name = renewer_kerberos_principal_name; } - public void unsetUser_name() { - this.user_name = null; + public void unsetRenewer_kerberos_principal_name() { + this.renewer_kerberos_principal_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; + /** Returns true if field renewer_kerberos_principal_name is set (has been asigned a value) and false otherwise */ + public boolean isSetRenewer_kerberos_principal_name() { + return this.renewer_kerberos_principal_name != null; } - public void setUser_nameIsSet(boolean value) { + public void setRenewer_kerberos_principal_nameIsSet(boolean value) { if (!value) { - 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 setGroup_namesIsSet(boolean value) { - if (!value) { - this.group_names = null; + this.renewer_kerberos_principal_name = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { - case HIVE_OBJECT: + case RENEWER_KERBEROS_PRINCIPAL_NAME: if (value == null) { - unsetHiveObject(); + unsetRenewer_kerberos_principal_name(); } else { - setHiveObject((HiveObjectRef)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); + setRenewer_kerberos_principal_name((String)value); } break; @@ -48180,14 +51542,8 @@ public class ThriftHiveMetastore { public Object getFieldValue(_Fields field) { switch (field) { - case HIVE_OBJECT: - return getHiveObject(); - - case USER_NAME: - return getUser_name(); - - case GROUP_NAMES: - return getGroup_names(); + case RENEWER_KERBEROS_PRINCIPAL_NAME: + return getRenewer_kerberos_principal_name(); } throw new IllegalStateException(); @@ -48200,12 +51556,8 @@ public class ThriftHiveMetastore { } switch (field) { - case HIVE_OBJECT: - return isSetHiveObject(); - case USER_NAME: - return isSetUser_name(); - case GROUP_NAMES: - return isSetGroup_names(); + case RENEWER_KERBEROS_PRINCIPAL_NAME: + return isSetRenewer_kerberos_principal_name(); } throw new IllegalStateException(); } @@ -48214,39 +51566,21 @@ public class ThriftHiveMetastore { public boolean equals(Object that) { if (that == null) return false; - if (that instanceof get_privilege_set_args) - return this.equals((get_privilege_set_args)that); + if (that instanceof get_delegation_token_args) + return this.equals((get_delegation_token_args)that); return false; } - public boolean equals(get_privilege_set_args that) { + public boolean equals(get_delegation_token_args that) { if (that == null) return false; - boolean this_present_hiveObject = true && this.isSetHiveObject(); - boolean that_present_hiveObject = true && that.isSetHiveObject(); - if (this_present_hiveObject || that_present_hiveObject) { - if (!(this_present_hiveObject && that_present_hiveObject)) - return false; - if (!this.hiveObject.equals(that.hiveObject)) - 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)) + boolean this_present_renewer_kerberos_principal_name = true && this.isSetRenewer_kerberos_principal_name(); + boolean that_present_renewer_kerberos_principal_name = true && that.isSetRenewer_kerberos_principal_name(); + if (this_present_renewer_kerberos_principal_name || that_present_renewer_kerberos_principal_name) { + if (!(this_present_renewer_kerberos_principal_name && that_present_renewer_kerberos_principal_name)) return false; - if (!this.group_names.equals(that.group_names)) + if (!this.renewer_kerberos_principal_name.equals(that.renewer_kerberos_principal_name)) return false; } @@ -48258,40 +51592,20 @@ public class ThriftHiveMetastore { return 0; } - public int compareTo(get_privilege_set_args other) { + public int compareTo(get_delegation_token_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; - get_privilege_set_args typedOther = (get_privilege_set_args)other; + get_delegation_token_args typedOther = (get_delegation_token_args)other; - lastComparison = Boolean.valueOf(isSetHiveObject()).compareTo(typedOther.isSetHiveObject()); + lastComparison = Boolean.valueOf(isSetRenewer_kerberos_principal_name()).compareTo(typedOther.isSetRenewer_kerberos_principal_name()); if (lastComparison != 0) { return lastComparison; } - if (isSetHiveObject()) { - lastComparison = TBaseHelper.compareTo(this.hiveObject, typedOther.hiveObject); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetUser_name()).compareTo(typedOther.isSetUser_name()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetUser_name()) { - lastComparison = TBaseHelper.compareTo(this.user_name, typedOther.user_name); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetGroup_names()).compareTo(typedOther.isSetGroup_names()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetGroup_names()) { - lastComparison = TBaseHelper.compareTo(this.group_names, typedOther.group_names); + if (isSetRenewer_kerberos_principal_name()) { + lastComparison = TBaseHelper.compareTo(this.renewer_kerberos_principal_name, typedOther.renewer_kerberos_principal_name); if (lastComparison != 0) { return lastComparison; } @@ -48313,34 +51627,9 @@ public class ThriftHiveMetastore { break; } switch (field.id) { - case 1: // HIVE_OBJECT - if (field.type == TType.STRUCT) { - this.hiveObject = new HiveObjectRef(); - this.hiveObject.read(iprot); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // USER_NAME + case 1: // RENEWER_KERBEROS_PRINCIPAL_NAME if (field.type == TType.STRING) { - this.user_name = iprot.readString(); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - case 3: // GROUP_NAMES - if (field.type == TType.LIST) { - { - TList _list216 = iprot.readListBegin(); - this.group_names = new ArrayList(_list216.size); - for (int _i217 = 0; _i217 < _list216.size; ++_i217) - { - String _elem218; - _elem218 = iprot.readString(); - this.group_names.add(_elem218); - } - iprot.readListEnd(); - } + this.renewer_kerberos_principal_name = iprot.readString(); } else { TProtocolUtil.skip(iprot, field.type); } @@ -48358,26 +51647,9 @@ public class ThriftHiveMetastore { validate(); oprot.writeStructBegin(STRUCT_DESC); - if (this.hiveObject != null) { - oprot.writeFieldBegin(HIVE_OBJECT_FIELD_DESC); - this.hiveObject.write(oprot); - 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 _iter219 : this.group_names) - { - oprot.writeString(_iter219); - } - oprot.writeListEnd(); - } + if (this.renewer_kerberos_principal_name != null) { + oprot.writeFieldBegin(RENEWER_KERBEROS_PRINCIPAL_NAME_FIELD_DESC); + oprot.writeString(this.renewer_kerberos_principal_name); oprot.writeFieldEnd(); } oprot.writeFieldStop(); @@ -48386,30 +51658,14 @@ public class ThriftHiveMetastore { @Override public String toString() { - StringBuilder sb = new StringBuilder("get_privilege_set_args("); + StringBuilder sb = new StringBuilder("get_delegation_token_args("); boolean first = true; - sb.append("hiveObject:"); - if (this.hiveObject == null) { - sb.append("null"); - } else { - sb.append(this.hiveObject); - } - 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("renewer_kerberos_principal_name:"); + if (this.renewer_kerberos_principal_name == null) { sb.append("null"); } else { - sb.append(this.group_names); + sb.append(this.renewer_kerberos_principal_name); } first = false; sb.append(")"); @@ -48422,13 +51678,13 @@ public class ThriftHiveMetastore { } - public static class get_privilege_set_result implements TBase, java.io.Serializable, Cloneable { - private static final TStruct STRUCT_DESC = new TStruct("get_privilege_set_result"); + public static class get_delegation_token_result implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("get_delegation_token_result"); - private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.STRUCT, (short)0); + 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 PrincipalPrivilegeSet success; + private String success; private MetaException o1; /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ @@ -48498,18 +51754,18 @@ public class ThriftHiveMetastore { static { Map<_Fields, FieldMetaData> tmpMap = new EnumMap<_Fields, FieldMetaData>(_Fields.class); tmpMap.put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, - new StructMetaData(TType.STRUCT, PrincipalPrivilegeSet.class))); + new FieldValueMetaData(TType.STRING))); tmpMap.put(_Fields.O1, new FieldMetaData("o1", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRUCT))); metaDataMap = Collections.unmodifiableMap(tmpMap); - FieldMetaData.addStructMetaDataMap(get_privilege_set_result.class, metaDataMap); + FieldMetaData.addStructMetaDataMap(get_delegation_token_result.class, metaDataMap); } - public get_privilege_set_result() { + public get_delegation_token_result() { } - public get_privilege_set_result( - PrincipalPrivilegeSet success, + public get_delegation_token_result( + String success, MetaException o1) { this(); @@ -48520,17 +51776,17 @@ public class ThriftHiveMetastore { /** * Performs a deep copy on other. */ - public get_privilege_set_result(get_privilege_set_result other) { + public get_delegation_token_result(get_delegation_token_result other) { if (other.isSetSuccess()) { - this.success = new PrincipalPrivilegeSet(other.success); + this.success = other.success; } if (other.isSetO1()) { this.o1 = new MetaException(other.o1); } } - public get_privilege_set_result deepCopy() { - return new get_privilege_set_result(this); + public get_delegation_token_result deepCopy() { + return new get_delegation_token_result(this); } @Override @@ -48539,11 +51795,11 @@ public class ThriftHiveMetastore { this.o1 = null; } - public PrincipalPrivilegeSet getSuccess() { + public String getSuccess() { return this.success; } - public void setSuccess(PrincipalPrivilegeSet success) { + public void setSuccess(String success) { this.success = success; } @@ -48591,7 +51847,7 @@ public class ThriftHiveMetastore { if (value == null) { unsetSuccess(); } else { - setSuccess((PrincipalPrivilegeSet)value); + setSuccess((String)value); } break; @@ -48637,12 +51893,12 @@ public class ThriftHiveMetastore { public boolean equals(Object that) { if (that == null) return false; - if (that instanceof get_privilege_set_result) - return this.equals((get_privilege_set_result)that); + if (that instanceof get_delegation_token_result) + return this.equals((get_delegation_token_result)that); return false; } - public boolean equals(get_privilege_set_result that) { + public boolean equals(get_delegation_token_result that) { if (that == null) return false; @@ -48672,13 +51928,13 @@ public class ThriftHiveMetastore { return 0; } - public int compareTo(get_privilege_set_result other) { + public int compareTo(get_delegation_token_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; - get_privilege_set_result typedOther = (get_privilege_set_result)other; + get_delegation_token_result typedOther = (get_delegation_token_result)other; lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess()); if (lastComparison != 0) { @@ -48718,9 +51974,8 @@ public class ThriftHiveMetastore { } switch (field.id) { case 0: // SUCCESS - if (field.type == TType.STRUCT) { - this.success = new PrincipalPrivilegeSet(); - this.success.read(iprot); + if (field.type == TType.STRING) { + this.success = iprot.readString(); } else { TProtocolUtil.skip(iprot, field.type); } @@ -48747,7 +52002,7 @@ public class ThriftHiveMetastore { if (this.isSetSuccess()) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - this.success.write(oprot); + oprot.writeString(this.success); oprot.writeFieldEnd(); } else if (this.isSetO1()) { oprot.writeFieldBegin(O1_FIELD_DESC); @@ -48760,7 +52015,7 @@ public class ThriftHiveMetastore { @Override public String toString() { - StringBuilder sb = new StringBuilder("get_privilege_set_result("); + StringBuilder sb = new StringBuilder("get_delegation_token_result("); boolean first = true; sb.append("success:"); @@ -48788,26 +52043,19 @@ public class ThriftHiveMetastore { } - public static class list_privileges_args implements TBase, java.io.Serializable, Cloneable { - private static final TStruct STRUCT_DESC = new TStruct("list_privileges_args"); + public static class get_delegation_token_with_signature_args implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("get_delegation_token_with_signature_args"); - private static final TField PRINCIPAL_NAME_FIELD_DESC = new TField("principal_name", TType.STRING, (short)1); - private static final TField PRINCIPAL_TYPE_FIELD_DESC = new TField("principal_type", TType.I32, (short)2); - private static final TField HIVE_OBJECT_FIELD_DESC = new TField("hiveObject", TType.STRUCT, (short)3); + private static final TField RENEWER_KERBEROS_PRINCIPAL_NAME_FIELD_DESC = new TField("renewer_kerberos_principal_name", TType.STRING, (short)1); + private static final TField TOKEN_SIGNATURE_FIELD_DESC = new TField("token_signature", TType.STRING, (short)2); - private String principal_name; - private PrincipalType principal_type; - private HiveObjectRef hiveObject; + private String renewer_kerberos_principal_name; + private String token_signature; /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements TFieldIdEnum { - PRINCIPAL_NAME((short)1, "principal_name"), - /** - * - * @see PrincipalType - */ - PRINCIPAL_TYPE((short)2, "principal_type"), - HIVE_OBJECT((short)3, "hiveObject"); + RENEWER_KERBEROS_PRINCIPAL_NAME((short)1, "renewer_kerberos_principal_name"), + TOKEN_SIGNATURE((short)2, "token_signature"); private static final Map byName = new HashMap(); @@ -48822,12 +52070,10 @@ public class ThriftHiveMetastore { */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { - case 1: // PRINCIPAL_NAME - return PRINCIPAL_NAME; - case 2: // PRINCIPAL_TYPE - return PRINCIPAL_TYPE; - case 3: // HIVE_OBJECT - return HIVE_OBJECT; + case 1: // RENEWER_KERBEROS_PRINCIPAL_NAME + return RENEWER_KERBEROS_PRINCIPAL_NAME; + case 2: // TOKEN_SIGNATURE + return TOKEN_SIGNATURE; default: return null; } @@ -48872,156 +52118,109 @@ public class ThriftHiveMetastore { public static final Map<_Fields, FieldMetaData> metaDataMap; static { Map<_Fields, FieldMetaData> tmpMap = new EnumMap<_Fields, FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.PRINCIPAL_NAME, new FieldMetaData("principal_name", TFieldRequirementType.DEFAULT, + tmpMap.put(_Fields.RENEWER_KERBEROS_PRINCIPAL_NAME, new FieldMetaData("renewer_kerberos_principal_name", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + tmpMap.put(_Fields.TOKEN_SIGNATURE, new FieldMetaData("token_signature", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRING))); - tmpMap.put(_Fields.PRINCIPAL_TYPE, new FieldMetaData("principal_type", TFieldRequirementType.DEFAULT, - new EnumMetaData(TType.ENUM, PrincipalType.class))); - tmpMap.put(_Fields.HIVE_OBJECT, new FieldMetaData("hiveObject", TFieldRequirementType.DEFAULT, - new StructMetaData(TType.STRUCT, HiveObjectRef.class))); metaDataMap = Collections.unmodifiableMap(tmpMap); - FieldMetaData.addStructMetaDataMap(list_privileges_args.class, metaDataMap); + FieldMetaData.addStructMetaDataMap(get_delegation_token_with_signature_args.class, metaDataMap); } - public list_privileges_args() { + public get_delegation_token_with_signature_args() { } - public list_privileges_args( - String principal_name, - PrincipalType principal_type, - HiveObjectRef hiveObject) + public get_delegation_token_with_signature_args( + String renewer_kerberos_principal_name, + String token_signature) { this(); - this.principal_name = principal_name; - this.principal_type = principal_type; - this.hiveObject = hiveObject; + this.renewer_kerberos_principal_name = renewer_kerberos_principal_name; + this.token_signature = token_signature; } /** * Performs a deep copy on other. */ - public list_privileges_args(list_privileges_args other) { - if (other.isSetPrincipal_name()) { - this.principal_name = other.principal_name; - } - if (other.isSetPrincipal_type()) { - this.principal_type = other.principal_type; + public get_delegation_token_with_signature_args(get_delegation_token_with_signature_args other) { + if (other.isSetRenewer_kerberos_principal_name()) { + this.renewer_kerberos_principal_name = other.renewer_kerberos_principal_name; } - if (other.isSetHiveObject()) { - this.hiveObject = new HiveObjectRef(other.hiveObject); + if (other.isSetToken_signature()) { + this.token_signature = other.token_signature; } } - public list_privileges_args deepCopy() { - return new list_privileges_args(this); + public get_delegation_token_with_signature_args deepCopy() { + return new get_delegation_token_with_signature_args(this); } @Override public void clear() { - this.principal_name = null; - this.principal_type = null; - this.hiveObject = null; + this.renewer_kerberos_principal_name = null; + this.token_signature = null; } - public String getPrincipal_name() { - return this.principal_name; + public String getRenewer_kerberos_principal_name() { + return this.renewer_kerberos_principal_name; } - public void setPrincipal_name(String principal_name) { - this.principal_name = principal_name; + public void setRenewer_kerberos_principal_name(String renewer_kerberos_principal_name) { + this.renewer_kerberos_principal_name = renewer_kerberos_principal_name; } - public void unsetPrincipal_name() { - this.principal_name = null; + public void unsetRenewer_kerberos_principal_name() { + this.renewer_kerberos_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; + /** Returns true if field renewer_kerberos_principal_name is set (has been asigned a value) and false otherwise */ + public boolean isSetRenewer_kerberos_principal_name() { + return this.renewer_kerberos_principal_name != null; } - public void setPrincipal_nameIsSet(boolean value) { + public void setRenewer_kerberos_principal_nameIsSet(boolean value) { if (!value) { - this.principal_name = null; + this.renewer_kerberos_principal_name = null; } } - /** - * - * @see PrincipalType - */ - public PrincipalType getPrincipal_type() { - return this.principal_type; + public String getToken_signature() { + return this.token_signature; } - /** - * - * @see PrincipalType - */ - public void setPrincipal_type(PrincipalType principal_type) { - this.principal_type = principal_type; + public void setToken_signature(String token_signature) { + this.token_signature = token_signature; } - public void unsetPrincipal_type() { - this.principal_type = null; + public void unsetToken_signature() { + this.token_signature = null; } - /** Returns true if field principal_type is set (has been asigned a value) and false otherwise */ - public boolean isSetPrincipal_type() { - return this.principal_type != null; + /** Returns true if field token_signature is set (has been asigned a value) and false otherwise */ + public boolean isSetToken_signature() { + return this.token_signature != null; } - public void setPrincipal_typeIsSet(boolean value) { + public void setToken_signatureIsSet(boolean value) { if (!value) { - this.principal_type = null; - } - } - - public HiveObjectRef getHiveObject() { - return this.hiveObject; - } - - public void setHiveObject(HiveObjectRef hiveObject) { - this.hiveObject = hiveObject; - } - - public void unsetHiveObject() { - this.hiveObject = null; - } - - /** Returns true if field hiveObject is set (has been asigned a value) and false otherwise */ - public boolean isSetHiveObject() { - return this.hiveObject != null; - } - - public void setHiveObjectIsSet(boolean value) { - if (!value) { - this.hiveObject = null; + this.token_signature = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { - case PRINCIPAL_NAME: + case RENEWER_KERBEROS_PRINCIPAL_NAME: if (value == null) { - unsetPrincipal_name(); + unsetRenewer_kerberos_principal_name(); } else { - setPrincipal_name((String)value); - } - break; - - case PRINCIPAL_TYPE: - if (value == null) { - unsetPrincipal_type(); - } else { - setPrincipal_type((PrincipalType)value); + setRenewer_kerberos_principal_name((String)value); } break; - case HIVE_OBJECT: + case TOKEN_SIGNATURE: if (value == null) { - unsetHiveObject(); + unsetToken_signature(); } else { - setHiveObject((HiveObjectRef)value); + setToken_signature((String)value); } break; @@ -49030,14 +52229,11 @@ public class ThriftHiveMetastore { public Object getFieldValue(_Fields field) { switch (field) { - case PRINCIPAL_NAME: - return getPrincipal_name(); + case RENEWER_KERBEROS_PRINCIPAL_NAME: + return getRenewer_kerberos_principal_name(); - case PRINCIPAL_TYPE: - return getPrincipal_type(); - - case HIVE_OBJECT: - return getHiveObject(); + case TOKEN_SIGNATURE: + return getToken_signature(); } throw new IllegalStateException(); @@ -49050,12 +52246,10 @@ public class ThriftHiveMetastore { } switch (field) { - case PRINCIPAL_NAME: - return isSetPrincipal_name(); - case PRINCIPAL_TYPE: - return isSetPrincipal_type(); - case HIVE_OBJECT: - return isSetHiveObject(); + case RENEWER_KERBEROS_PRINCIPAL_NAME: + return isSetRenewer_kerberos_principal_name(); + case TOKEN_SIGNATURE: + return isSetToken_signature(); } throw new IllegalStateException(); } @@ -49064,39 +52258,30 @@ public class ThriftHiveMetastore { public boolean equals(Object that) { if (that == null) return false; - if (that instanceof list_privileges_args) - return this.equals((list_privileges_args)that); + if (that instanceof get_delegation_token_with_signature_args) + return this.equals((get_delegation_token_with_signature_args)that); return false; } - public boolean equals(list_privileges_args that) { + public boolean equals(get_delegation_token_with_signature_args that) { if (that == null) return false; - 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.principal_name.equals(that.principal_name)) - return false; - } - - boolean this_present_principal_type = true && this.isSetPrincipal_type(); - boolean that_present_principal_type = true && that.isSetPrincipal_type(); - if (this_present_principal_type || that_present_principal_type) { - if (!(this_present_principal_type && that_present_principal_type)) + boolean this_present_renewer_kerberos_principal_name = true && this.isSetRenewer_kerberos_principal_name(); + boolean that_present_renewer_kerberos_principal_name = true && that.isSetRenewer_kerberos_principal_name(); + if (this_present_renewer_kerberos_principal_name || that_present_renewer_kerberos_principal_name) { + if (!(this_present_renewer_kerberos_principal_name && that_present_renewer_kerberos_principal_name)) return false; - if (!this.principal_type.equals(that.principal_type)) + if (!this.renewer_kerberos_principal_name.equals(that.renewer_kerberos_principal_name)) return false; } - boolean this_present_hiveObject = true && this.isSetHiveObject(); - boolean that_present_hiveObject = true && that.isSetHiveObject(); - if (this_present_hiveObject || that_present_hiveObject) { - if (!(this_present_hiveObject && that_present_hiveObject)) + boolean this_present_token_signature = true && this.isSetToken_signature(); + boolean that_present_token_signature = true && that.isSetToken_signature(); + if (this_present_token_signature || that_present_token_signature) { + if (!(this_present_token_signature && that_present_token_signature)) return false; - if (!this.hiveObject.equals(that.hiveObject)) + if (!this.token_signature.equals(that.token_signature)) return false; } @@ -49108,40 +52293,30 @@ public class ThriftHiveMetastore { return 0; } - public int compareTo(list_privileges_args other) { + public int compareTo(get_delegation_token_with_signature_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; - list_privileges_args typedOther = (list_privileges_args)other; + get_delegation_token_with_signature_args typedOther = (get_delegation_token_with_signature_args)other; - lastComparison = Boolean.valueOf(isSetPrincipal_name()).compareTo(typedOther.isSetPrincipal_name()); + lastComparison = Boolean.valueOf(isSetRenewer_kerberos_principal_name()).compareTo(typedOther.isSetRenewer_kerberos_principal_name()); if (lastComparison != 0) { return lastComparison; } - if (isSetPrincipal_name()) { - lastComparison = TBaseHelper.compareTo(this.principal_name, typedOther.principal_name); + if (isSetRenewer_kerberos_principal_name()) { + lastComparison = TBaseHelper.compareTo(this.renewer_kerberos_principal_name, typedOther.renewer_kerberos_principal_name); if (lastComparison != 0) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetPrincipal_type()).compareTo(typedOther.isSetPrincipal_type()); + lastComparison = Boolean.valueOf(isSetToken_signature()).compareTo(typedOther.isSetToken_signature()); if (lastComparison != 0) { return lastComparison; } - if (isSetPrincipal_type()) { - lastComparison = TBaseHelper.compareTo(this.principal_type, typedOther.principal_type); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetHiveObject()).compareTo(typedOther.isSetHiveObject()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetHiveObject()) { - lastComparison = TBaseHelper.compareTo(this.hiveObject, typedOther.hiveObject); + if (isSetToken_signature()) { + lastComparison = TBaseHelper.compareTo(this.token_signature, typedOther.token_signature); if (lastComparison != 0) { return lastComparison; } @@ -49163,24 +52338,16 @@ public class ThriftHiveMetastore { break; } switch (field.id) { - case 1: // PRINCIPAL_NAME + case 1: // RENEWER_KERBEROS_PRINCIPAL_NAME if (field.type == TType.STRING) { - this.principal_name = iprot.readString(); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // PRINCIPAL_TYPE - if (field.type == TType.I32) { - this.principal_type = PrincipalType.findByValue(iprot.readI32()); + this.renewer_kerberos_principal_name = iprot.readString(); } else { TProtocolUtil.skip(iprot, field.type); } break; - case 3: // HIVE_OBJECT - if (field.type == TType.STRUCT) { - this.hiveObject = new HiveObjectRef(); - this.hiveObject.read(iprot); + case 2: // TOKEN_SIGNATURE + if (field.type == TType.STRING) { + this.token_signature = iprot.readString(); } else { TProtocolUtil.skip(iprot, field.type); } @@ -49198,19 +52365,14 @@ public class ThriftHiveMetastore { validate(); oprot.writeStructBegin(STRUCT_DESC); - if (this.principal_name != null) { - oprot.writeFieldBegin(PRINCIPAL_NAME_FIELD_DESC); - oprot.writeString(this.principal_name); + if (this.renewer_kerberos_principal_name != null) { + oprot.writeFieldBegin(RENEWER_KERBEROS_PRINCIPAL_NAME_FIELD_DESC); + oprot.writeString(this.renewer_kerberos_principal_name); oprot.writeFieldEnd(); } - if (this.principal_type != null) { - oprot.writeFieldBegin(PRINCIPAL_TYPE_FIELD_DESC); - oprot.writeI32(this.principal_type.getValue()); - oprot.writeFieldEnd(); - } - if (this.hiveObject != null) { - oprot.writeFieldBegin(HIVE_OBJECT_FIELD_DESC); - this.hiveObject.write(oprot); + if (this.token_signature != null) { + oprot.writeFieldBegin(TOKEN_SIGNATURE_FIELD_DESC); + oprot.writeString(this.token_signature); oprot.writeFieldEnd(); } oprot.writeFieldStop(); @@ -49219,30 +52381,22 @@ public class ThriftHiveMetastore { @Override public String toString() { - StringBuilder sb = new StringBuilder("list_privileges_args("); + StringBuilder sb = new StringBuilder("get_delegation_token_with_signature_args("); boolean first = true; - sb.append("principal_name:"); - if (this.principal_name == null) { + sb.append("renewer_kerberos_principal_name:"); + if (this.renewer_kerberos_principal_name == null) { sb.append("null"); } else { - sb.append(this.principal_name); + sb.append(this.renewer_kerberos_principal_name); } first = false; if (!first) sb.append(", "); - sb.append("principal_type:"); - if (this.principal_type == null) { + sb.append("token_signature:"); + if (this.token_signature == null) { sb.append("null"); } else { - sb.append(this.principal_type); - } - first = false; - if (!first) sb.append(", "); - sb.append("hiveObject:"); - if (this.hiveObject == null) { - sb.append("null"); - } else { - sb.append(this.hiveObject); + sb.append(this.token_signature); } first = false; sb.append(")"); @@ -49255,13 +52409,13 @@ public class ThriftHiveMetastore { } - public static class list_privileges_result implements TBase, java.io.Serializable, Cloneable { - private static final TStruct STRUCT_DESC = new TStruct("list_privileges_result"); + public static class get_delegation_token_with_signature_result implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("get_delegation_token_with_signature_result"); - private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.LIST, (short)0); + 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 List success; + private String success; private MetaException o1; /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ @@ -49331,19 +52485,18 @@ public class ThriftHiveMetastore { static { Map<_Fields, FieldMetaData> tmpMap = new EnumMap<_Fields, FieldMetaData>(_Fields.class); tmpMap.put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, - new ListMetaData(TType.LIST, - new StructMetaData(TType.STRUCT, HiveObjectPrivilege.class)))); + new FieldValueMetaData(TType.STRING))); tmpMap.put(_Fields.O1, new FieldMetaData("o1", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRUCT))); metaDataMap = Collections.unmodifiableMap(tmpMap); - FieldMetaData.addStructMetaDataMap(list_privileges_result.class, metaDataMap); + FieldMetaData.addStructMetaDataMap(get_delegation_token_with_signature_result.class, metaDataMap); } - public list_privileges_result() { + public get_delegation_token_with_signature_result() { } - public list_privileges_result( - List success, + public get_delegation_token_with_signature_result( + String success, MetaException o1) { this(); @@ -49354,21 +52507,17 @@ public class ThriftHiveMetastore { /** * Performs a deep copy on other. */ - public list_privileges_result(list_privileges_result other) { + public get_delegation_token_with_signature_result(get_delegation_token_with_signature_result other) { if (other.isSetSuccess()) { - List __this__success = new ArrayList(); - for (HiveObjectPrivilege other_element : other.success) { - __this__success.add(new HiveObjectPrivilege(other_element)); - } - this.success = __this__success; + this.success = other.success; } if (other.isSetO1()) { this.o1 = new MetaException(other.o1); } } - public list_privileges_result deepCopy() { - return new list_privileges_result(this); + public get_delegation_token_with_signature_result deepCopy() { + return new get_delegation_token_with_signature_result(this); } @Override @@ -49377,26 +52526,11 @@ public class ThriftHiveMetastore { this.o1 = null; } - 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(HiveObjectPrivilege elem) { - if (this.success == null) { - this.success = new ArrayList(); - } - this.success.add(elem); - } - - public List getSuccess() { + public String getSuccess() { return this.success; } - public void setSuccess(List success) { + public void setSuccess(String success) { this.success = success; } @@ -49444,7 +52578,7 @@ public class ThriftHiveMetastore { if (value == null) { unsetSuccess(); } else { - setSuccess((List)value); + setSuccess((String)value); } break; @@ -49490,12 +52624,12 @@ public class ThriftHiveMetastore { public boolean equals(Object that) { if (that == null) return false; - if (that instanceof list_privileges_result) - return this.equals((list_privileges_result)that); + if (that instanceof get_delegation_token_with_signature_result) + return this.equals((get_delegation_token_with_signature_result)that); return false; } - public boolean equals(list_privileges_result that) { + public boolean equals(get_delegation_token_with_signature_result that) { if (that == null) return false; @@ -49525,13 +52659,13 @@ public class ThriftHiveMetastore { return 0; } - public int compareTo(list_privileges_result other) { + public int compareTo(get_delegation_token_with_signature_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; - list_privileges_result typedOther = (list_privileges_result)other; + get_delegation_token_with_signature_result typedOther = (get_delegation_token_with_signature_result)other; lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess()); if (lastComparison != 0) { @@ -49571,19 +52705,8 @@ public class ThriftHiveMetastore { } switch (field.id) { case 0: // SUCCESS - if (field.type == TType.LIST) { - { - TList _list220 = iprot.readListBegin(); - this.success = new ArrayList(_list220.size); - for (int _i221 = 0; _i221 < _list220.size; ++_i221) - { - HiveObjectPrivilege _elem222; - _elem222 = new HiveObjectPrivilege(); - _elem222.read(iprot); - this.success.add(_elem222); - } - iprot.readListEnd(); - } + if (field.type == TType.STRING) { + this.success = iprot.readString(); } else { TProtocolUtil.skip(iprot, field.type); } @@ -49610,14 +52733,7 @@ public class ThriftHiveMetastore { if (this.isSetSuccess()) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - { - oprot.writeListBegin(new TList(TType.STRUCT, this.success.size())); - for (HiveObjectPrivilege _iter223 : this.success) - { - _iter223.write(oprot); - } - oprot.writeListEnd(); - } + oprot.writeString(this.success); oprot.writeFieldEnd(); } else if (this.isSetO1()) { oprot.writeFieldBegin(O1_FIELD_DESC); @@ -49630,7 +52746,7 @@ public class ThriftHiveMetastore { @Override public String toString() { - StringBuilder sb = new StringBuilder("list_privileges_result("); + StringBuilder sb = new StringBuilder("get_delegation_token_with_signature_result("); boolean first = true; sb.append("success:"); @@ -49658,16 +52774,16 @@ public class ThriftHiveMetastore { } - public static class grant_privileges_args implements TBase, java.io.Serializable, Cloneable { - private static final TStruct STRUCT_DESC = new TStruct("grant_privileges_args"); + public static class renew_delegation_token_args implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("renew_delegation_token_args"); - private static final TField PRIVILEGES_FIELD_DESC = new TField("privileges", TType.STRUCT, (short)1); + private static final TField TOKEN_STR_FORM_FIELD_DESC = new TField("token_str_form", TType.STRING, (short)1); - private PrivilegeBag privileges; + private String token_str_form; /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements TFieldIdEnum { - PRIVILEGES((short)1, "privileges"); + TOKEN_STR_FORM((short)1, "token_str_form"); private static final Map byName = new HashMap(); @@ -49682,8 +52798,8 @@ public class ThriftHiveMetastore { */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { - case 1: // PRIVILEGES - return PRIVILEGES; + case 1: // TOKEN_STR_FORM + return TOKEN_STR_FORM; default: return null; } @@ -49728,70 +52844,70 @@ public class ThriftHiveMetastore { public static final Map<_Fields, FieldMetaData> metaDataMap; static { Map<_Fields, FieldMetaData> tmpMap = new EnumMap<_Fields, FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.PRIVILEGES, new FieldMetaData("privileges", TFieldRequirementType.DEFAULT, - new StructMetaData(TType.STRUCT, PrivilegeBag.class))); + tmpMap.put(_Fields.TOKEN_STR_FORM, new FieldMetaData("token_str_form", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); metaDataMap = Collections.unmodifiableMap(tmpMap); - FieldMetaData.addStructMetaDataMap(grant_privileges_args.class, metaDataMap); + FieldMetaData.addStructMetaDataMap(renew_delegation_token_args.class, metaDataMap); } - public grant_privileges_args() { + public renew_delegation_token_args() { } - public grant_privileges_args( - PrivilegeBag privileges) + public renew_delegation_token_args( + String token_str_form) { this(); - this.privileges = privileges; + this.token_str_form = token_str_form; } /** * Performs a deep copy on other. */ - public grant_privileges_args(grant_privileges_args other) { - if (other.isSetPrivileges()) { - this.privileges = new PrivilegeBag(other.privileges); + public renew_delegation_token_args(renew_delegation_token_args other) { + if (other.isSetToken_str_form()) { + this.token_str_form = other.token_str_form; } } - public grant_privileges_args deepCopy() { - return new grant_privileges_args(this); + public renew_delegation_token_args deepCopy() { + return new renew_delegation_token_args(this); } @Override public void clear() { - this.privileges = null; + this.token_str_form = null; } - public PrivilegeBag getPrivileges() { - return this.privileges; + public String getToken_str_form() { + return this.token_str_form; } - public void setPrivileges(PrivilegeBag privileges) { - this.privileges = privileges; + public void setToken_str_form(String token_str_form) { + this.token_str_form = token_str_form; } - public void unsetPrivileges() { - this.privileges = null; + public void unsetToken_str_form() { + this.token_str_form = null; } - /** Returns true if field privileges is set (has been asigned a value) and false otherwise */ - public boolean isSetPrivileges() { - return this.privileges != null; + /** Returns true if field token_str_form is set (has been asigned a value) and false otherwise */ + public boolean isSetToken_str_form() { + return this.token_str_form != null; } - public void setPrivilegesIsSet(boolean value) { + public void setToken_str_formIsSet(boolean value) { if (!value) { - this.privileges = null; + this.token_str_form = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { - case PRIVILEGES: + case TOKEN_STR_FORM: if (value == null) { - unsetPrivileges(); + unsetToken_str_form(); } else { - setPrivileges((PrivilegeBag)value); + setToken_str_form((String)value); } break; @@ -49800,8 +52916,8 @@ public class ThriftHiveMetastore { public Object getFieldValue(_Fields field) { switch (field) { - case PRIVILEGES: - return getPrivileges(); + case TOKEN_STR_FORM: + return getToken_str_form(); } throw new IllegalStateException(); @@ -49814,8 +52930,8 @@ public class ThriftHiveMetastore { } switch (field) { - case PRIVILEGES: - return isSetPrivileges(); + case TOKEN_STR_FORM: + return isSetToken_str_form(); } throw new IllegalStateException(); } @@ -49824,21 +52940,21 @@ public class ThriftHiveMetastore { public boolean equals(Object that) { if (that == null) return false; - if (that instanceof grant_privileges_args) - return this.equals((grant_privileges_args)that); + if (that instanceof renew_delegation_token_args) + return this.equals((renew_delegation_token_args)that); return false; } - public boolean equals(grant_privileges_args that) { + public boolean equals(renew_delegation_token_args that) { if (that == null) 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)) + boolean this_present_token_str_form = true && this.isSetToken_str_form(); + boolean that_present_token_str_form = true && that.isSetToken_str_form(); + if (this_present_token_str_form || that_present_token_str_form) { + if (!(this_present_token_str_form && that_present_token_str_form)) return false; - if (!this.privileges.equals(that.privileges)) + if (!this.token_str_form.equals(that.token_str_form)) return false; } @@ -49850,20 +52966,20 @@ public class ThriftHiveMetastore { return 0; } - public int compareTo(grant_privileges_args other) { + public int compareTo(renew_delegation_token_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; - grant_privileges_args typedOther = (grant_privileges_args)other; + renew_delegation_token_args typedOther = (renew_delegation_token_args)other; - lastComparison = Boolean.valueOf(isSetPrivileges()).compareTo(typedOther.isSetPrivileges()); + lastComparison = Boolean.valueOf(isSetToken_str_form()).compareTo(typedOther.isSetToken_str_form()); if (lastComparison != 0) { return lastComparison; } - if (isSetPrivileges()) { - lastComparison = TBaseHelper.compareTo(this.privileges, typedOther.privileges); + if (isSetToken_str_form()) { + lastComparison = TBaseHelper.compareTo(this.token_str_form, typedOther.token_str_form); if (lastComparison != 0) { return lastComparison; } @@ -49885,10 +53001,9 @@ public class ThriftHiveMetastore { break; } switch (field.id) { - case 1: // PRIVILEGES - if (field.type == TType.STRUCT) { - this.privileges = new PrivilegeBag(); - this.privileges.read(iprot); + case 1: // TOKEN_STR_FORM + if (field.type == TType.STRING) { + this.token_str_form = iprot.readString(); } else { TProtocolUtil.skip(iprot, field.type); } @@ -49906,9 +53021,9 @@ public class ThriftHiveMetastore { validate(); oprot.writeStructBegin(STRUCT_DESC); - if (this.privileges != null) { - oprot.writeFieldBegin(PRIVILEGES_FIELD_DESC); - this.privileges.write(oprot); + if (this.token_str_form != null) { + oprot.writeFieldBegin(TOKEN_STR_FORM_FIELD_DESC); + oprot.writeString(this.token_str_form); oprot.writeFieldEnd(); } oprot.writeFieldStop(); @@ -49917,14 +53032,14 @@ public class ThriftHiveMetastore { @Override public String toString() { - StringBuilder sb = new StringBuilder("grant_privileges_args("); + StringBuilder sb = new StringBuilder("renew_delegation_token_args("); boolean first = true; - sb.append("privileges:"); - if (this.privileges == null) { + sb.append("token_str_form:"); + if (this.token_str_form == null) { sb.append("null"); } else { - sb.append(this.privileges); + sb.append(this.token_str_form); } first = false; sb.append(")"); @@ -49937,13 +53052,13 @@ public class ThriftHiveMetastore { } - public static class grant_privileges_result implements TBase, java.io.Serializable, Cloneable { - private static final TStruct STRUCT_DESC = new TStruct("grant_privileges_result"); + public static class renew_delegation_token_result implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("renew_delegation_token_result"); - private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.BOOL, (short)0); + private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.I64, (short)0); private static final TField O1_FIELD_DESC = new TField("o1", TType.STRUCT, (short)1); - private boolean success; + private long success; private MetaException o1; /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ @@ -50015,18 +53130,18 @@ public class ThriftHiveMetastore { static { Map<_Fields, FieldMetaData> tmpMap = new EnumMap<_Fields, FieldMetaData>(_Fields.class); tmpMap.put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.BOOL))); + new FieldValueMetaData(TType.I64))); tmpMap.put(_Fields.O1, new FieldMetaData("o1", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRUCT))); metaDataMap = Collections.unmodifiableMap(tmpMap); - FieldMetaData.addStructMetaDataMap(grant_privileges_result.class, metaDataMap); + FieldMetaData.addStructMetaDataMap(renew_delegation_token_result.class, metaDataMap); } - public grant_privileges_result() { + public renew_delegation_token_result() { } - public grant_privileges_result( - boolean success, + public renew_delegation_token_result( + long success, MetaException o1) { this(); @@ -50038,7 +53153,7 @@ public class ThriftHiveMetastore { /** * Performs a deep copy on other. */ - public grant_privileges_result(grant_privileges_result other) { + public renew_delegation_token_result(renew_delegation_token_result other) { __isset_bit_vector.clear(); __isset_bit_vector.or(other.__isset_bit_vector); this.success = other.success; @@ -50047,22 +53162,22 @@ public class ThriftHiveMetastore { } } - public grant_privileges_result deepCopy() { - return new grant_privileges_result(this); + public renew_delegation_token_result deepCopy() { + return new renew_delegation_token_result(this); } @Override public void clear() { setSuccessIsSet(false); - this.success = false; + this.success = 0; this.o1 = null; } - public boolean isSuccess() { + public long getSuccess() { return this.success; } - public void setSuccess(boolean success) { + public void setSuccess(long success) { this.success = success; setSuccessIsSet(true); } @@ -50109,7 +53224,7 @@ public class ThriftHiveMetastore { if (value == null) { unsetSuccess(); } else { - setSuccess((Boolean)value); + setSuccess((Long)value); } break; @@ -50127,7 +53242,7 @@ public class ThriftHiveMetastore { public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: - return new Boolean(isSuccess()); + return new Long(getSuccess()); case O1: return getO1(); @@ -50155,12 +53270,12 @@ public class ThriftHiveMetastore { public boolean equals(Object that) { if (that == null) return false; - if (that instanceof grant_privileges_result) - return this.equals((grant_privileges_result)that); + if (that instanceof renew_delegation_token_result) + return this.equals((renew_delegation_token_result)that); return false; } - public boolean equals(grant_privileges_result that) { + public boolean equals(renew_delegation_token_result that) { if (that == null) return false; @@ -50190,13 +53305,13 @@ public class ThriftHiveMetastore { return 0; } - public int compareTo(grant_privileges_result other) { + public int compareTo(renew_delegation_token_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; - grant_privileges_result typedOther = (grant_privileges_result)other; + renew_delegation_token_result typedOther = (renew_delegation_token_result)other; lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess()); if (lastComparison != 0) { @@ -50236,8 +53351,8 @@ public class ThriftHiveMetastore { } switch (field.id) { case 0: // SUCCESS - if (field.type == TType.BOOL) { - this.success = iprot.readBool(); + if (field.type == TType.I64) { + this.success = iprot.readI64(); setSuccessIsSet(true); } else { TProtocolUtil.skip(iprot, field.type); @@ -50265,7 +53380,7 @@ public class ThriftHiveMetastore { if (this.isSetSuccess()) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - oprot.writeBool(this.success); + oprot.writeI64(this.success); oprot.writeFieldEnd(); } else if (this.isSetO1()) { oprot.writeFieldBegin(O1_FIELD_DESC); @@ -50278,7 +53393,7 @@ public class ThriftHiveMetastore { @Override public String toString() { - StringBuilder sb = new StringBuilder("grant_privileges_result("); + StringBuilder sb = new StringBuilder("renew_delegation_token_result("); boolean first = true; sb.append("success:"); @@ -50302,16 +53417,16 @@ public class ThriftHiveMetastore { } - public static class revoke_privileges_args implements TBase, java.io.Serializable, Cloneable { - private static final TStruct STRUCT_DESC = new TStruct("revoke_privileges_args"); + public static class cancel_delegation_token_args implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("cancel_delegation_token_args"); - private static final TField PRIVILEGES_FIELD_DESC = new TField("privileges", TType.STRUCT, (short)1); + private static final TField TOKEN_STR_FORM_FIELD_DESC = new TField("token_str_form", TType.STRING, (short)1); - private PrivilegeBag privileges; + private String token_str_form; /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements TFieldIdEnum { - PRIVILEGES((short)1, "privileges"); + TOKEN_STR_FORM((short)1, "token_str_form"); private static final Map byName = new HashMap(); @@ -50326,8 +53441,8 @@ public class ThriftHiveMetastore { */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { - case 1: // PRIVILEGES - return PRIVILEGES; + case 1: // TOKEN_STR_FORM + return TOKEN_STR_FORM; default: return null; } @@ -50372,70 +53487,70 @@ public class ThriftHiveMetastore { public static final Map<_Fields, FieldMetaData> metaDataMap; static { Map<_Fields, FieldMetaData> tmpMap = new EnumMap<_Fields, FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.PRIVILEGES, new FieldMetaData("privileges", TFieldRequirementType.DEFAULT, - new StructMetaData(TType.STRUCT, PrivilegeBag.class))); + tmpMap.put(_Fields.TOKEN_STR_FORM, new FieldMetaData("token_str_form", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); metaDataMap = Collections.unmodifiableMap(tmpMap); - FieldMetaData.addStructMetaDataMap(revoke_privileges_args.class, metaDataMap); + FieldMetaData.addStructMetaDataMap(cancel_delegation_token_args.class, metaDataMap); } - public revoke_privileges_args() { + public cancel_delegation_token_args() { } - public revoke_privileges_args( - PrivilegeBag privileges) + public cancel_delegation_token_args( + String token_str_form) { this(); - this.privileges = privileges; + this.token_str_form = token_str_form; } /** * Performs a deep copy on other. */ - public revoke_privileges_args(revoke_privileges_args other) { - if (other.isSetPrivileges()) { - this.privileges = new PrivilegeBag(other.privileges); + public cancel_delegation_token_args(cancel_delegation_token_args other) { + if (other.isSetToken_str_form()) { + this.token_str_form = other.token_str_form; } } - public revoke_privileges_args deepCopy() { - return new revoke_privileges_args(this); + public cancel_delegation_token_args deepCopy() { + return new cancel_delegation_token_args(this); } @Override public void clear() { - this.privileges = null; + this.token_str_form = null; } - public PrivilegeBag getPrivileges() { - return this.privileges; + public String getToken_str_form() { + return this.token_str_form; } - public void setPrivileges(PrivilegeBag privileges) { - this.privileges = privileges; + public void setToken_str_form(String token_str_form) { + this.token_str_form = token_str_form; } - public void unsetPrivileges() { - this.privileges = null; + public void unsetToken_str_form() { + this.token_str_form = null; } - /** Returns true if field privileges is set (has been asigned a value) and false otherwise */ - public boolean isSetPrivileges() { - return this.privileges != null; + /** Returns true if field token_str_form is set (has been asigned a value) and false otherwise */ + public boolean isSetToken_str_form() { + return this.token_str_form != null; } - public void setPrivilegesIsSet(boolean value) { + public void setToken_str_formIsSet(boolean value) { if (!value) { - this.privileges = null; + this.token_str_form = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { - case PRIVILEGES: + case TOKEN_STR_FORM: if (value == null) { - unsetPrivileges(); + unsetToken_str_form(); } else { - setPrivileges((PrivilegeBag)value); + setToken_str_form((String)value); } break; @@ -50444,8 +53559,8 @@ public class ThriftHiveMetastore { public Object getFieldValue(_Fields field) { switch (field) { - case PRIVILEGES: - return getPrivileges(); + case TOKEN_STR_FORM: + return getToken_str_form(); } throw new IllegalStateException(); @@ -50458,8 +53573,8 @@ public class ThriftHiveMetastore { } switch (field) { - case PRIVILEGES: - return isSetPrivileges(); + case TOKEN_STR_FORM: + return isSetToken_str_form(); } throw new IllegalStateException(); } @@ -50468,21 +53583,21 @@ public class ThriftHiveMetastore { public boolean equals(Object that) { if (that == null) return false; - if (that instanceof revoke_privileges_args) - return this.equals((revoke_privileges_args)that); + if (that instanceof cancel_delegation_token_args) + return this.equals((cancel_delegation_token_args)that); return false; } - public boolean equals(revoke_privileges_args that) { + public boolean equals(cancel_delegation_token_args that) { if (that == null) 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)) + boolean this_present_token_str_form = true && this.isSetToken_str_form(); + boolean that_present_token_str_form = true && that.isSetToken_str_form(); + if (this_present_token_str_form || that_present_token_str_form) { + if (!(this_present_token_str_form && that_present_token_str_form)) return false; - if (!this.privileges.equals(that.privileges)) + if (!this.token_str_form.equals(that.token_str_form)) return false; } @@ -50494,20 +53609,20 @@ public class ThriftHiveMetastore { return 0; } - public int compareTo(revoke_privileges_args other) { + public int compareTo(cancel_delegation_token_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; - revoke_privileges_args typedOther = (revoke_privileges_args)other; + cancel_delegation_token_args typedOther = (cancel_delegation_token_args)other; - lastComparison = Boolean.valueOf(isSetPrivileges()).compareTo(typedOther.isSetPrivileges()); + lastComparison = Boolean.valueOf(isSetToken_str_form()).compareTo(typedOther.isSetToken_str_form()); if (lastComparison != 0) { return lastComparison; } - if (isSetPrivileges()) { - lastComparison = TBaseHelper.compareTo(this.privileges, typedOther.privileges); + if (isSetToken_str_form()) { + lastComparison = TBaseHelper.compareTo(this.token_str_form, typedOther.token_str_form); if (lastComparison != 0) { return lastComparison; } @@ -50529,10 +53644,9 @@ public class ThriftHiveMetastore { break; } switch (field.id) { - case 1: // PRIVILEGES - if (field.type == TType.STRUCT) { - this.privileges = new PrivilegeBag(); - this.privileges.read(iprot); + case 1: // TOKEN_STR_FORM + if (field.type == TType.STRING) { + this.token_str_form = iprot.readString(); } else { TProtocolUtil.skip(iprot, field.type); } @@ -50550,9 +53664,9 @@ public class ThriftHiveMetastore { validate(); oprot.writeStructBegin(STRUCT_DESC); - if (this.privileges != null) { - oprot.writeFieldBegin(PRIVILEGES_FIELD_DESC); - this.privileges.write(oprot); + if (this.token_str_form != null) { + oprot.writeFieldBegin(TOKEN_STR_FORM_FIELD_DESC); + oprot.writeString(this.token_str_form); oprot.writeFieldEnd(); } oprot.writeFieldStop(); @@ -50561,14 +53675,14 @@ public class ThriftHiveMetastore { @Override public String toString() { - StringBuilder sb = new StringBuilder("revoke_privileges_args("); + StringBuilder sb = new StringBuilder("cancel_delegation_token_args("); boolean first = true; - sb.append("privileges:"); - if (this.privileges == null) { + sb.append("token_str_form:"); + if (this.token_str_form == null) { sb.append("null"); } else { - sb.append(this.privileges); + sb.append(this.token_str_form); } first = false; sb.append(")"); @@ -50581,18 +53695,15 @@ public class ThriftHiveMetastore { } - public static class revoke_privileges_result implements TBase, java.io.Serializable, Cloneable { - private static final TStruct STRUCT_DESC = new TStruct("revoke_privileges_result"); + public static class cancel_delegation_token_result implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("cancel_delegation_token_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 boolean success; private MetaException o1; /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements TFieldIdEnum { - SUCCESS((short)0, "success"), O1((short)1, "o1"); private static final Map byName = new HashMap(); @@ -50608,8 +53719,6 @@ public class ThriftHiveMetastore { */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { - case 0: // SUCCESS - return SUCCESS; case 1: // O1 return O1; default: @@ -50652,78 +53761,44 @@ public class ThriftHiveMetastore { } // isset id assignments - private static final int __SUCCESS_ISSET_ID = 0; - private BitSet __isset_bit_vector = new BitSet(1); public static final Map<_Fields, FieldMetaData> metaDataMap; static { Map<_Fields, FieldMetaData> tmpMap = new EnumMap<_Fields, FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.BOOL))); tmpMap.put(_Fields.O1, new FieldMetaData("o1", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRUCT))); metaDataMap = Collections.unmodifiableMap(tmpMap); - FieldMetaData.addStructMetaDataMap(revoke_privileges_result.class, metaDataMap); + FieldMetaData.addStructMetaDataMap(cancel_delegation_token_result.class, metaDataMap); } - public revoke_privileges_result() { + public cancel_delegation_token_result() { } - public revoke_privileges_result( - boolean success, + public cancel_delegation_token_result( MetaException o1) { this(); - this.success = success; - setSuccessIsSet(true); this.o1 = o1; } /** * Performs a deep copy on other. */ - public revoke_privileges_result(revoke_privileges_result other) { - __isset_bit_vector.clear(); - __isset_bit_vector.or(other.__isset_bit_vector); - this.success = other.success; + public cancel_delegation_token_result(cancel_delegation_token_result other) { if (other.isSetO1()) { this.o1 = new MetaException(other.o1); } } - public revoke_privileges_result deepCopy() { - return new revoke_privileges_result(this); + public cancel_delegation_token_result deepCopy() { + return new cancel_delegation_token_result(this); } @Override public void clear() { - setSuccessIsSet(false); - this.success = false; this.o1 = null; } - public boolean isSuccess() { - return this.success; - } - - public void setSuccess(boolean success) { - this.success = success; - setSuccessIsSet(true); - } - - public void unsetSuccess() { - __isset_bit_vector.clear(__SUCCESS_ISSET_ID); - } - - /** Returns true if field success is set (has been asigned a value) and false otherwise */ - public boolean isSetSuccess() { - return __isset_bit_vector.get(__SUCCESS_ISSET_ID); - } - - public void setSuccessIsSet(boolean value) { - __isset_bit_vector.set(__SUCCESS_ISSET_ID, value); - } - public MetaException getO1() { return this.o1; } @@ -50749,14 +53824,6 @@ public class ThriftHiveMetastore { public void setFieldValue(_Fields field, Object value) { switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((Boolean)value); - } - break; - case O1: if (value == null) { unsetO1(); @@ -50770,9 +53837,6 @@ public class ThriftHiveMetastore { public Object getFieldValue(_Fields field) { switch (field) { - case SUCCESS: - return new Boolean(isSuccess()); - case O1: return getO1(); @@ -50787,8 +53851,6 @@ public class ThriftHiveMetastore { } switch (field) { - case SUCCESS: - return isSetSuccess(); case O1: return isSetO1(); } @@ -50799,24 +53861,15 @@ public class ThriftHiveMetastore { public boolean equals(Object that) { if (that == null) return false; - if (that instanceof revoke_privileges_result) - return this.equals((revoke_privileges_result)that); + if (that instanceof cancel_delegation_token_result) + return this.equals((cancel_delegation_token_result)that); return false; } - public boolean equals(revoke_privileges_result that) { + public boolean equals(cancel_delegation_token_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) { @@ -50834,24 +53887,14 @@ public class ThriftHiveMetastore { return 0; } - public int compareTo(revoke_privileges_result other) { + public int compareTo(cancel_delegation_token_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; - revoke_privileges_result typedOther = (revoke_privileges_result)other; + cancel_delegation_token_result typedOther = (cancel_delegation_token_result)other; - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = TBaseHelper.compareTo(this.success, typedOther.success); - if (lastComparison != 0) { - return lastComparison; - } - } lastComparison = Boolean.valueOf(isSetO1()).compareTo(typedOther.isSetO1()); if (lastComparison != 0) { return lastComparison; @@ -50879,14 +53922,6 @@ public class ThriftHiveMetastore { break; } switch (field.id) { - case 0: // SUCCESS - if (field.type == TType.BOOL) { - this.success = iprot.readBool(); - setSuccessIsSet(true); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; case 1: // O1 if (field.type == TType.STRUCT) { this.o1 = new MetaException(); @@ -50907,11 +53942,7 @@ public class ThriftHiveMetastore { 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()) { + if (this.isSetO1()) { oprot.writeFieldBegin(O1_FIELD_DESC); this.o1.write(oprot); oprot.writeFieldEnd(); @@ -50922,13 +53953,9 @@ public class ThriftHiveMetastore { @Override public String toString() { - StringBuilder sb = new StringBuilder("revoke_privileges_result("); + StringBuilder sb = new StringBuilder("cancel_delegation_token_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"); diff --git metastore/src/gen/thrift/gen-php/hive_metastore/ThriftHiveMetastore.php metastore/src/gen/thrift/gen-php/hive_metastore/ThriftHiveMetastore.php index 0eadd66..6ccca5c 100644 --- metastore/src/gen/thrift/gen-php/hive_metastore/ThriftHiveMetastore.php +++ metastore/src/gen/thrift/gen-php/hive_metastore/ThriftHiveMetastore.php @@ -62,6 +62,10 @@ interface ThriftHiveMetastoreIf extends FacebookServiceIf { public function list_privileges($principal_name, $principal_type, $hiveObject); public function grant_privileges($privileges); public function revoke_privileges($privileges); + public function get_delegation_token($renewer_kerberos_principal_name); + public function get_delegation_token_with_signature($renewer_kerberos_principal_name, $token_signature); + public function renew_delegation_token($token_str_form); + public function cancel_delegation_token($token_str_form); } class ThriftHiveMetastoreClient extends FacebookServiceClient implements ThriftHiveMetastoreIf { @@ -3056,6 +3060,220 @@ class ThriftHiveMetastoreClient extends FacebookServiceClient implements ThriftH throw new Exception("revoke_privileges failed: unknown result"); } + public function get_delegation_token($renewer_kerberos_principal_name) + { + $this->send_get_delegation_token($renewer_kerberos_principal_name); + return $this->recv_get_delegation_token(); + } + + public function send_get_delegation_token($renewer_kerberos_principal_name) + { + $args = new metastore_ThriftHiveMetastore_get_delegation_token_args(); + $args->renewer_kerberos_principal_name = $renewer_kerberos_principal_name; + $bin_accel = ($this->output_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_write_binary'); + if ($bin_accel) + { + thrift_protocol_write_binary($this->output_, 'get_delegation_token', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite()); + } + else + { + $this->output_->writeMessageBegin('get_delegation_token', TMessageType::CALL, $this->seqid_); + $args->write($this->output_); + $this->output_->writeMessageEnd(); + $this->output_->getTransport()->flush(); + } + } + + public function recv_get_delegation_token() + { + $bin_accel = ($this->input_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_read_binary'); + if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, 'metastore_ThriftHiveMetastore_get_delegation_token_result', $this->input_->isStrictRead()); + else + { + $rseqid = 0; + $fname = null; + $mtype = 0; + + $this->input_->readMessageBegin($fname, $mtype, $rseqid); + if ($mtype == TMessageType::EXCEPTION) { + $x = new TApplicationException(); + $x->read($this->input_); + $this->input_->readMessageEnd(); + throw $x; + } + $result = new metastore_ThriftHiveMetastore_get_delegation_token_result(); + $result->read($this->input_); + $this->input_->readMessageEnd(); + } + if ($result->success !== null) { + return $result->success; + } + if ($result->o1 !== null) { + throw $result->o1; + } + throw new Exception("get_delegation_token failed: unknown result"); + } + + public function get_delegation_token_with_signature($renewer_kerberos_principal_name, $token_signature) + { + $this->send_get_delegation_token_with_signature($renewer_kerberos_principal_name, $token_signature); + return $this->recv_get_delegation_token_with_signature(); + } + + public function send_get_delegation_token_with_signature($renewer_kerberos_principal_name, $token_signature) + { + $args = new metastore_ThriftHiveMetastore_get_delegation_token_with_signature_args(); + $args->renewer_kerberos_principal_name = $renewer_kerberos_principal_name; + $args->token_signature = $token_signature; + $bin_accel = ($this->output_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_write_binary'); + if ($bin_accel) + { + thrift_protocol_write_binary($this->output_, 'get_delegation_token_with_signature', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite()); + } + else + { + $this->output_->writeMessageBegin('get_delegation_token_with_signature', TMessageType::CALL, $this->seqid_); + $args->write($this->output_); + $this->output_->writeMessageEnd(); + $this->output_->getTransport()->flush(); + } + } + + public function recv_get_delegation_token_with_signature() + { + $bin_accel = ($this->input_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_read_binary'); + if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, 'metastore_ThriftHiveMetastore_get_delegation_token_with_signature_result', $this->input_->isStrictRead()); + else + { + $rseqid = 0; + $fname = null; + $mtype = 0; + + $this->input_->readMessageBegin($fname, $mtype, $rseqid); + if ($mtype == TMessageType::EXCEPTION) { + $x = new TApplicationException(); + $x->read($this->input_); + $this->input_->readMessageEnd(); + throw $x; + } + $result = new metastore_ThriftHiveMetastore_get_delegation_token_with_signature_result(); + $result->read($this->input_); + $this->input_->readMessageEnd(); + } + if ($result->success !== null) { + return $result->success; + } + if ($result->o1 !== null) { + throw $result->o1; + } + throw new Exception("get_delegation_token_with_signature failed: unknown result"); + } + + public function renew_delegation_token($token_str_form) + { + $this->send_renew_delegation_token($token_str_form); + return $this->recv_renew_delegation_token(); + } + + public function send_renew_delegation_token($token_str_form) + { + $args = new metastore_ThriftHiveMetastore_renew_delegation_token_args(); + $args->token_str_form = $token_str_form; + $bin_accel = ($this->output_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_write_binary'); + if ($bin_accel) + { + thrift_protocol_write_binary($this->output_, 'renew_delegation_token', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite()); + } + else + { + $this->output_->writeMessageBegin('renew_delegation_token', TMessageType::CALL, $this->seqid_); + $args->write($this->output_); + $this->output_->writeMessageEnd(); + $this->output_->getTransport()->flush(); + } + } + + public function recv_renew_delegation_token() + { + $bin_accel = ($this->input_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_read_binary'); + if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, 'metastore_ThriftHiveMetastore_renew_delegation_token_result', $this->input_->isStrictRead()); + else + { + $rseqid = 0; + $fname = null; + $mtype = 0; + + $this->input_->readMessageBegin($fname, $mtype, $rseqid); + if ($mtype == TMessageType::EXCEPTION) { + $x = new TApplicationException(); + $x->read($this->input_); + $this->input_->readMessageEnd(); + throw $x; + } + $result = new metastore_ThriftHiveMetastore_renew_delegation_token_result(); + $result->read($this->input_); + $this->input_->readMessageEnd(); + } + if ($result->success !== null) { + return $result->success; + } + if ($result->o1 !== null) { + throw $result->o1; + } + throw new Exception("renew_delegation_token failed: unknown result"); + } + + public function cancel_delegation_token($token_str_form) + { + $this->send_cancel_delegation_token($token_str_form); + $this->recv_cancel_delegation_token(); + } + + public function send_cancel_delegation_token($token_str_form) + { + $args = new metastore_ThriftHiveMetastore_cancel_delegation_token_args(); + $args->token_str_form = $token_str_form; + $bin_accel = ($this->output_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_write_binary'); + if ($bin_accel) + { + thrift_protocol_write_binary($this->output_, 'cancel_delegation_token', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite()); + } + else + { + $this->output_->writeMessageBegin('cancel_delegation_token', TMessageType::CALL, $this->seqid_); + $args->write($this->output_); + $this->output_->writeMessageEnd(); + $this->output_->getTransport()->flush(); + } + } + + public function recv_cancel_delegation_token() + { + $bin_accel = ($this->input_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_read_binary'); + if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, 'metastore_ThriftHiveMetastore_cancel_delegation_token_result', $this->input_->isStrictRead()); + else + { + $rseqid = 0; + $fname = null; + $mtype = 0; + + $this->input_->readMessageBegin($fname, $mtype, $rseqid); + if ($mtype == TMessageType::EXCEPTION) { + $x = new TApplicationException(); + $x->read($this->input_); + $this->input_->readMessageEnd(); + throw $x; + } + $result = new metastore_ThriftHiveMetastore_cancel_delegation_token_result(); + $result->read($this->input_); + $this->input_->readMessageEnd(); + } + if ($result->o1 !== null) { + throw $result->o1; + } + return; + } + } // HELPER FUNCTIONS AND STRUCTURES @@ -14973,4 +15191,668 @@ class metastore_ThriftHiveMetastore_revoke_privileges_result { } +class metastore_ThriftHiveMetastore_get_delegation_token_args { + static $_TSPEC; + + public $renewer_kerberos_principal_name = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 1 => array( + 'var' => 'renewer_kerberos_principal_name', + 'type' => TType::STRING, + ), + ); + } + if (is_array($vals)) { + if (isset($vals['renewer_kerberos_principal_name'])) { + $this->renewer_kerberos_principal_name = $vals['renewer_kerberos_principal_name']; + } + } + } + + public function getName() { + return 'ThriftHiveMetastore_get_delegation_token_args'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 1: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->renewer_kerberos_principal_name); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('ThriftHiveMetastore_get_delegation_token_args'); + if ($this->renewer_kerberos_principal_name !== null) { + $xfer += $output->writeFieldBegin('renewer_kerberos_principal_name', TType::STRING, 1); + $xfer += $output->writeString($this->renewer_kerberos_principal_name); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class metastore_ThriftHiveMetastore_get_delegation_token_result { + static $_TSPEC; + + public $success = null; + public $o1 = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 0 => array( + 'var' => 'success', + 'type' => TType::STRING, + ), + 1 => array( + 'var' => 'o1', + 'type' => TType::STRUCT, + 'class' => 'metastore_MetaException', + ), + ); + } + if (is_array($vals)) { + if (isset($vals['success'])) { + $this->success = $vals['success']; + } + if (isset($vals['o1'])) { + $this->o1 = $vals['o1']; + } + } + } + + public function getName() { + return 'ThriftHiveMetastore_get_delegation_token_result'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 0: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->success); + } else { + $xfer += $input->skip($ftype); + } + break; + case 1: + if ($ftype == TType::STRUCT) { + $this->o1 = new metastore_MetaException(); + $xfer += $this->o1->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('ThriftHiveMetastore_get_delegation_token_result'); + if ($this->success !== null) { + $xfer += $output->writeFieldBegin('success', TType::STRING, 0); + $xfer += $output->writeString($this->success); + $xfer += $output->writeFieldEnd(); + } + if ($this->o1 !== null) { + $xfer += $output->writeFieldBegin('o1', TType::STRUCT, 1); + $xfer += $this->o1->write($output); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class metastore_ThriftHiveMetastore_get_delegation_token_with_signature_args { + static $_TSPEC; + + public $renewer_kerberos_principal_name = null; + public $token_signature = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 1 => array( + 'var' => 'renewer_kerberos_principal_name', + 'type' => TType::STRING, + ), + 2 => array( + 'var' => 'token_signature', + 'type' => TType::STRING, + ), + ); + } + if (is_array($vals)) { + if (isset($vals['renewer_kerberos_principal_name'])) { + $this->renewer_kerberos_principal_name = $vals['renewer_kerberos_principal_name']; + } + if (isset($vals['token_signature'])) { + $this->token_signature = $vals['token_signature']; + } + } + } + + public function getName() { + return 'ThriftHiveMetastore_get_delegation_token_with_signature_args'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 1: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->renewer_kerberos_principal_name); + } else { + $xfer += $input->skip($ftype); + } + break; + case 2: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->token_signature); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('ThriftHiveMetastore_get_delegation_token_with_signature_args'); + if ($this->renewer_kerberos_principal_name !== null) { + $xfer += $output->writeFieldBegin('renewer_kerberos_principal_name', TType::STRING, 1); + $xfer += $output->writeString($this->renewer_kerberos_principal_name); + $xfer += $output->writeFieldEnd(); + } + if ($this->token_signature !== null) { + $xfer += $output->writeFieldBegin('token_signature', TType::STRING, 2); + $xfer += $output->writeString($this->token_signature); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class metastore_ThriftHiveMetastore_get_delegation_token_with_signature_result { + static $_TSPEC; + + public $success = null; + public $o1 = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 0 => array( + 'var' => 'success', + 'type' => TType::STRING, + ), + 1 => array( + 'var' => 'o1', + 'type' => TType::STRUCT, + 'class' => 'metastore_MetaException', + ), + ); + } + if (is_array($vals)) { + if (isset($vals['success'])) { + $this->success = $vals['success']; + } + if (isset($vals['o1'])) { + $this->o1 = $vals['o1']; + } + } + } + + public function getName() { + return 'ThriftHiveMetastore_get_delegation_token_with_signature_result'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 0: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->success); + } else { + $xfer += $input->skip($ftype); + } + break; + case 1: + if ($ftype == TType::STRUCT) { + $this->o1 = new metastore_MetaException(); + $xfer += $this->o1->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('ThriftHiveMetastore_get_delegation_token_with_signature_result'); + if ($this->success !== null) { + $xfer += $output->writeFieldBegin('success', TType::STRING, 0); + $xfer += $output->writeString($this->success); + $xfer += $output->writeFieldEnd(); + } + if ($this->o1 !== null) { + $xfer += $output->writeFieldBegin('o1', TType::STRUCT, 1); + $xfer += $this->o1->write($output); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class metastore_ThriftHiveMetastore_renew_delegation_token_args { + static $_TSPEC; + + public $token_str_form = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 1 => array( + 'var' => 'token_str_form', + 'type' => TType::STRING, + ), + ); + } + if (is_array($vals)) { + if (isset($vals['token_str_form'])) { + $this->token_str_form = $vals['token_str_form']; + } + } + } + + public function getName() { + return 'ThriftHiveMetastore_renew_delegation_token_args'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 1: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->token_str_form); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('ThriftHiveMetastore_renew_delegation_token_args'); + if ($this->token_str_form !== null) { + $xfer += $output->writeFieldBegin('token_str_form', TType::STRING, 1); + $xfer += $output->writeString($this->token_str_form); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class metastore_ThriftHiveMetastore_renew_delegation_token_result { + static $_TSPEC; + + public $success = null; + public $o1 = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 0 => array( + 'var' => 'success', + 'type' => TType::I64, + ), + 1 => array( + 'var' => 'o1', + 'type' => TType::STRUCT, + 'class' => 'metastore_MetaException', + ), + ); + } + if (is_array($vals)) { + if (isset($vals['success'])) { + $this->success = $vals['success']; + } + if (isset($vals['o1'])) { + $this->o1 = $vals['o1']; + } + } + } + + public function getName() { + return 'ThriftHiveMetastore_renew_delegation_token_result'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 0: + if ($ftype == TType::I64) { + $xfer += $input->readI64($this->success); + } else { + $xfer += $input->skip($ftype); + } + break; + case 1: + if ($ftype == TType::STRUCT) { + $this->o1 = new metastore_MetaException(); + $xfer += $this->o1->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('ThriftHiveMetastore_renew_delegation_token_result'); + if ($this->success !== null) { + $xfer += $output->writeFieldBegin('success', TType::I64, 0); + $xfer += $output->writeI64($this->success); + $xfer += $output->writeFieldEnd(); + } + if ($this->o1 !== null) { + $xfer += $output->writeFieldBegin('o1', TType::STRUCT, 1); + $xfer += $this->o1->write($output); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class metastore_ThriftHiveMetastore_cancel_delegation_token_args { + static $_TSPEC; + + public $token_str_form = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 1 => array( + 'var' => 'token_str_form', + 'type' => TType::STRING, + ), + ); + } + if (is_array($vals)) { + if (isset($vals['token_str_form'])) { + $this->token_str_form = $vals['token_str_form']; + } + } + } + + public function getName() { + return 'ThriftHiveMetastore_cancel_delegation_token_args'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 1: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->token_str_form); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('ThriftHiveMetastore_cancel_delegation_token_args'); + if ($this->token_str_form !== null) { + $xfer += $output->writeFieldBegin('token_str_form', TType::STRING, 1); + $xfer += $output->writeString($this->token_str_form); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class metastore_ThriftHiveMetastore_cancel_delegation_token_result { + static $_TSPEC; + + public $o1 = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 1 => array( + 'var' => 'o1', + 'type' => TType::STRUCT, + 'class' => 'metastore_MetaException', + ), + ); + } + if (is_array($vals)) { + if (isset($vals['o1'])) { + $this->o1 = $vals['o1']; + } + } + } + + public function getName() { + return 'ThriftHiveMetastore_cancel_delegation_token_result'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 1: + if ($ftype == TType::STRUCT) { + $this->o1 = new metastore_MetaException(); + $xfer += $this->o1->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('ThriftHiveMetastore_cancel_delegation_token_result'); + if ($this->o1 !== null) { + $xfer += $output->writeFieldBegin('o1', TType::STRUCT, 1); + $xfer += $this->o1->write($output); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + ?> diff --git metastore/src/gen/thrift/gen-py/hive_metastore/ThriftHiveMetastore-remote metastore/src/gen/thrift/gen-py/hive_metastore/ThriftHiveMetastore-remote old mode 100644 new mode 100755 index aa656b5..ba773ce --- metastore/src/gen/thrift/gen-py/hive_metastore/ThriftHiveMetastore-remote +++ metastore/src/gen/thrift/gen-py/hive_metastore/ThriftHiveMetastore-remote @@ -73,6 +73,10 @@ if len(sys.argv) <= 1 or sys.argv[1] == '--help': print ' list_privileges(string principal_name, PrincipalType principal_type, HiveObjectRef hiveObject)' print ' bool grant_privileges(PrivilegeBag privileges)' print ' bool revoke_privileges(PrivilegeBag privileges)' + print ' string get_delegation_token(string renewer_kerberos_principal_name)' + print ' string get_delegation_token_with_signature(string renewer_kerberos_principal_name, string token_signature)' + print ' i64 renew_delegation_token(string token_str_form)' + print ' void cancel_delegation_token(string token_str_form)' print '' sys.exit(0) @@ -435,6 +439,30 @@ elif cmd == 'revoke_privileges': sys.exit(1) pp.pprint(client.revoke_privileges(eval(args[0]),)) +elif cmd == 'get_delegation_token': + if len(args) != 1: + print 'get_delegation_token requires 1 args' + sys.exit(1) + pp.pprint(client.get_delegation_token(args[0],)) + +elif cmd == 'get_delegation_token_with_signature': + if len(args) != 2: + print 'get_delegation_token_with_signature requires 2 args' + sys.exit(1) + pp.pprint(client.get_delegation_token_with_signature(args[0],args[1],)) + +elif cmd == 'renew_delegation_token': + if len(args) != 1: + print 'renew_delegation_token requires 1 args' + sys.exit(1) + pp.pprint(client.renew_delegation_token(args[0],)) + +elif cmd == 'cancel_delegation_token': + if len(args) != 1: + print 'cancel_delegation_token requires 1 args' + sys.exit(1) + pp.pprint(client.cancel_delegation_token(args[0],)) + else: print 'Unrecognized method %s' % cmd sys.exit(1) diff --git metastore/src/gen/thrift/gen-py/hive_metastore/ThriftHiveMetastore.py metastore/src/gen/thrift/gen-py/hive_metastore/ThriftHiveMetastore.py index deea25d..9a8db06 100644 --- metastore/src/gen/thrift/gen-py/hive_metastore/ThriftHiveMetastore.py +++ metastore/src/gen/thrift/gen-py/hive_metastore/ThriftHiveMetastore.py @@ -458,6 +458,35 @@ class Iface(fb303.FacebookService.Iface): """ pass + def get_delegation_token(self, renewer_kerberos_principal_name): + """ + Parameters: + - renewer_kerberos_principal_name + """ + pass + + def get_delegation_token_with_signature(self, renewer_kerberos_principal_name, token_signature): + """ + Parameters: + - renewer_kerberos_principal_name + - token_signature + """ + pass + + def renew_delegation_token(self, token_str_form): + """ + Parameters: + - token_str_form + """ + pass + + def cancel_delegation_token(self, token_str_form): + """ + Parameters: + - token_str_form + """ + pass + class Client(fb303.FacebookService.Client, Iface): """ @@ -2349,6 +2378,134 @@ class Client(fb303.FacebookService.Client, Iface): raise result.o1 raise TApplicationException(TApplicationException.MISSING_RESULT, "revoke_privileges failed: unknown result"); + def get_delegation_token(self, renewer_kerberos_principal_name): + """ + Parameters: + - renewer_kerberos_principal_name + """ + self.send_get_delegation_token(renewer_kerberos_principal_name) + return self.recv_get_delegation_token() + + def send_get_delegation_token(self, renewer_kerberos_principal_name): + self._oprot.writeMessageBegin('get_delegation_token', TMessageType.CALL, self._seqid) + args = get_delegation_token_args() + args.renewer_kerberos_principal_name = renewer_kerberos_principal_name + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_get_delegation_token(self, ): + (fname, mtype, rseqid) = self._iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(self._iprot) + self._iprot.readMessageEnd() + raise x + result = get_delegation_token_result() + result.read(self._iprot) + self._iprot.readMessageEnd() + if result.success != None: + return result.success + if result.o1 != None: + raise result.o1 + raise TApplicationException(TApplicationException.MISSING_RESULT, "get_delegation_token failed: unknown result"); + + def get_delegation_token_with_signature(self, renewer_kerberos_principal_name, token_signature): + """ + Parameters: + - renewer_kerberos_principal_name + - token_signature + """ + self.send_get_delegation_token_with_signature(renewer_kerberos_principal_name, token_signature) + return self.recv_get_delegation_token_with_signature() + + def send_get_delegation_token_with_signature(self, renewer_kerberos_principal_name, token_signature): + self._oprot.writeMessageBegin('get_delegation_token_with_signature', TMessageType.CALL, self._seqid) + args = get_delegation_token_with_signature_args() + args.renewer_kerberos_principal_name = renewer_kerberos_principal_name + args.token_signature = token_signature + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_get_delegation_token_with_signature(self, ): + (fname, mtype, rseqid) = self._iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(self._iprot) + self._iprot.readMessageEnd() + raise x + result = get_delegation_token_with_signature_result() + result.read(self._iprot) + self._iprot.readMessageEnd() + if result.success != None: + return result.success + if result.o1 != None: + raise result.o1 + raise TApplicationException(TApplicationException.MISSING_RESULT, "get_delegation_token_with_signature failed: unknown result"); + + def renew_delegation_token(self, token_str_form): + """ + Parameters: + - token_str_form + """ + self.send_renew_delegation_token(token_str_form) + return self.recv_renew_delegation_token() + + def send_renew_delegation_token(self, token_str_form): + self._oprot.writeMessageBegin('renew_delegation_token', TMessageType.CALL, self._seqid) + args = renew_delegation_token_args() + args.token_str_form = token_str_form + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_renew_delegation_token(self, ): + (fname, mtype, rseqid) = self._iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(self._iprot) + self._iprot.readMessageEnd() + raise x + result = renew_delegation_token_result() + result.read(self._iprot) + self._iprot.readMessageEnd() + if result.success != None: + return result.success + if result.o1 != None: + raise result.o1 + raise TApplicationException(TApplicationException.MISSING_RESULT, "renew_delegation_token failed: unknown result"); + + def cancel_delegation_token(self, token_str_form): + """ + Parameters: + - token_str_form + """ + self.send_cancel_delegation_token(token_str_form) + self.recv_cancel_delegation_token() + + def send_cancel_delegation_token(self, token_str_form): + self._oprot.writeMessageBegin('cancel_delegation_token', TMessageType.CALL, self._seqid) + args = cancel_delegation_token_args() + args.token_str_form = token_str_form + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_cancel_delegation_token(self, ): + (fname, mtype, rseqid) = self._iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(self._iprot) + self._iprot.readMessageEnd() + raise x + result = cancel_delegation_token_result() + result.read(self._iprot) + self._iprot.readMessageEnd() + if result.o1 != None: + raise result.o1 + return + class Processor(fb303.FacebookService.Processor, Iface, TProcessor): def __init__(self, handler): @@ -2405,6 +2562,10 @@ class Processor(fb303.FacebookService.Processor, Iface, TProcessor): self._processMap["list_privileges"] = Processor.process_list_privileges self._processMap["grant_privileges"] = Processor.process_grant_privileges self._processMap["revoke_privileges"] = Processor.process_revoke_privileges + self._processMap["get_delegation_token"] = Processor.process_get_delegation_token + self._processMap["get_delegation_token_with_signature"] = Processor.process_get_delegation_token_with_signature + self._processMap["renew_delegation_token"] = Processor.process_renew_delegation_token + self._processMap["cancel_delegation_token"] = Processor.process_cancel_delegation_token def process(self, iprot, oprot): (name, type, seqid) = iprot.readMessageBegin() @@ -3233,6 +3394,62 @@ class Processor(fb303.FacebookService.Processor, Iface, TProcessor): oprot.writeMessageEnd() oprot.trans.flush() + def process_get_delegation_token(self, seqid, iprot, oprot): + args = get_delegation_token_args() + args.read(iprot) + iprot.readMessageEnd() + result = get_delegation_token_result() + try: + result.success = self._handler.get_delegation_token(args.renewer_kerberos_principal_name) + except MetaException, o1: + result.o1 = o1 + oprot.writeMessageBegin("get_delegation_token", TMessageType.REPLY, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_get_delegation_token_with_signature(self, seqid, iprot, oprot): + args = get_delegation_token_with_signature_args() + args.read(iprot) + iprot.readMessageEnd() + result = get_delegation_token_with_signature_result() + try: + result.success = self._handler.get_delegation_token_with_signature(args.renewer_kerberos_principal_name, args.token_signature) + except MetaException, o1: + result.o1 = o1 + oprot.writeMessageBegin("get_delegation_token_with_signature", TMessageType.REPLY, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_renew_delegation_token(self, seqid, iprot, oprot): + args = renew_delegation_token_args() + args.read(iprot) + iprot.readMessageEnd() + result = renew_delegation_token_result() + try: + result.success = self._handler.renew_delegation_token(args.token_str_form) + except MetaException, o1: + result.o1 = o1 + oprot.writeMessageBegin("renew_delegation_token", TMessageType.REPLY, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_cancel_delegation_token(self, seqid, iprot, oprot): + args = cancel_delegation_token_args() + args.read(iprot) + iprot.readMessageEnd() + result = cancel_delegation_token_result() + try: + self._handler.cancel_delegation_token(args.token_str_form) + except MetaException, o1: + result.o1 = o1 + oprot.writeMessageBegin("cancel_delegation_token", TMessageType.REPLY, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + # HELPER FUNCTIONS AND STRUCTURES @@ -11661,3 +11878,524 @@ class revoke_privileges_result: def __ne__(self, other): return not (self == other) + +class get_delegation_token_args: + """ + Attributes: + - renewer_kerberos_principal_name + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRING, 'renewer_kerberos_principal_name', None, None, ), # 1 + ) + + def __init__(self, renewer_kerberos_principal_name=None,): + self.renewer_kerberos_principal_name = renewer_kerberos_principal_name + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + self.renewer_kerberos_principal_name = iprot.readString(); + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('get_delegation_token_args') + if self.renewer_kerberos_principal_name != None: + oprot.writeFieldBegin('renewer_kerberos_principal_name', TType.STRING, 1) + oprot.writeString(self.renewer_kerberos_principal_name) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class get_delegation_token_result: + """ + Attributes: + - success + - o1 + """ + + thrift_spec = ( + (0, TType.STRING, 'success', None, None, ), # 0 + (1, TType.STRUCT, 'o1', (MetaException, MetaException.thrift_spec), None, ), # 1 + ) + + def __init__(self, success=None, o1=None,): + self.success = success + self.o1 = o1 + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 0: + if ftype == TType.STRING: + self.success = iprot.readString(); + else: + iprot.skip(ftype) + elif fid == 1: + if ftype == TType.STRUCT: + self.o1 = MetaException() + self.o1.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('get_delegation_token_result') + if self.success != None: + oprot.writeFieldBegin('success', TType.STRING, 0) + oprot.writeString(self.success) + oprot.writeFieldEnd() + if self.o1 != None: + oprot.writeFieldBegin('o1', TType.STRUCT, 1) + self.o1.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class get_delegation_token_with_signature_args: + """ + Attributes: + - renewer_kerberos_principal_name + - token_signature + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRING, 'renewer_kerberos_principal_name', None, None, ), # 1 + (2, TType.STRING, 'token_signature', None, None, ), # 2 + ) + + def __init__(self, renewer_kerberos_principal_name=None, token_signature=None,): + self.renewer_kerberos_principal_name = renewer_kerberos_principal_name + self.token_signature = token_signature + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + self.renewer_kerberos_principal_name = iprot.readString(); + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRING: + self.token_signature = iprot.readString(); + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('get_delegation_token_with_signature_args') + if self.renewer_kerberos_principal_name != None: + oprot.writeFieldBegin('renewer_kerberos_principal_name', TType.STRING, 1) + oprot.writeString(self.renewer_kerberos_principal_name) + oprot.writeFieldEnd() + if self.token_signature != None: + oprot.writeFieldBegin('token_signature', TType.STRING, 2) + oprot.writeString(self.token_signature) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class get_delegation_token_with_signature_result: + """ + Attributes: + - success + - o1 + """ + + thrift_spec = ( + (0, TType.STRING, 'success', None, None, ), # 0 + (1, TType.STRUCT, 'o1', (MetaException, MetaException.thrift_spec), None, ), # 1 + ) + + def __init__(self, success=None, o1=None,): + self.success = success + self.o1 = o1 + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 0: + if ftype == TType.STRING: + self.success = iprot.readString(); + else: + iprot.skip(ftype) + elif fid == 1: + if ftype == TType.STRUCT: + self.o1 = MetaException() + self.o1.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('get_delegation_token_with_signature_result') + if self.success != None: + oprot.writeFieldBegin('success', TType.STRING, 0) + oprot.writeString(self.success) + oprot.writeFieldEnd() + if self.o1 != None: + oprot.writeFieldBegin('o1', TType.STRUCT, 1) + self.o1.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class renew_delegation_token_args: + """ + Attributes: + - token_str_form + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRING, 'token_str_form', None, None, ), # 1 + ) + + def __init__(self, token_str_form=None,): + self.token_str_form = token_str_form + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + self.token_str_form = iprot.readString(); + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('renew_delegation_token_args') + if self.token_str_form != None: + oprot.writeFieldBegin('token_str_form', TType.STRING, 1) + oprot.writeString(self.token_str_form) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class renew_delegation_token_result: + """ + Attributes: + - success + - o1 + """ + + thrift_spec = ( + (0, TType.I64, 'success', None, None, ), # 0 + (1, TType.STRUCT, 'o1', (MetaException, MetaException.thrift_spec), None, ), # 1 + ) + + def __init__(self, success=None, o1=None,): + self.success = success + self.o1 = o1 + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 0: + if ftype == TType.I64: + self.success = iprot.readI64(); + else: + iprot.skip(ftype) + elif fid == 1: + if ftype == TType.STRUCT: + self.o1 = MetaException() + self.o1.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('renew_delegation_token_result') + if self.success != None: + oprot.writeFieldBegin('success', TType.I64, 0) + oprot.writeI64(self.success) + oprot.writeFieldEnd() + if self.o1 != None: + oprot.writeFieldBegin('o1', TType.STRUCT, 1) + self.o1.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class cancel_delegation_token_args: + """ + Attributes: + - token_str_form + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRING, 'token_str_form', None, None, ), # 1 + ) + + def __init__(self, token_str_form=None,): + self.token_str_form = token_str_form + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + self.token_str_form = iprot.readString(); + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('cancel_delegation_token_args') + if self.token_str_form != None: + oprot.writeFieldBegin('token_str_form', TType.STRING, 1) + oprot.writeString(self.token_str_form) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class cancel_delegation_token_result: + """ + Attributes: + - o1 + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'o1', (MetaException, MetaException.thrift_spec), None, ), # 1 + ) + + def __init__(self, o1=None,): + self.o1 = o1 + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRUCT: + self.o1 = MetaException() + self.o1.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('cancel_delegation_token_result') + if self.o1 != None: + oprot.writeFieldBegin('o1', TType.STRUCT, 1) + self.o1.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) diff --git metastore/src/gen/thrift/gen-rb/thrift_hive_metastore.rb metastore/src/gen/thrift/gen-rb/thrift_hive_metastore.rb index d169b67..7458b2a 100644 --- metastore/src/gen/thrift/gen-rb/thrift_hive_metastore.rb +++ metastore/src/gen/thrift/gen-rb/thrift_hive_metastore.rb @@ -878,6 +878,69 @@ module ThriftHiveMetastore raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'revoke_privileges failed: unknown result') end + def get_delegation_token(renewer_kerberos_principal_name) + send_get_delegation_token(renewer_kerberos_principal_name) + return recv_get_delegation_token() + end + + def send_get_delegation_token(renewer_kerberos_principal_name) + send_message('get_delegation_token', Get_delegation_token_args, :renewer_kerberos_principal_name => renewer_kerberos_principal_name) + end + + def recv_get_delegation_token() + result = receive_message(Get_delegation_token_result) + return result.success unless result.success.nil? + raise result.o1 unless result.o1.nil? + raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'get_delegation_token failed: unknown result') + end + + def get_delegation_token_with_signature(renewer_kerberos_principal_name, token_signature) + send_get_delegation_token_with_signature(renewer_kerberos_principal_name, token_signature) + return recv_get_delegation_token_with_signature() + end + + def send_get_delegation_token_with_signature(renewer_kerberos_principal_name, token_signature) + send_message('get_delegation_token_with_signature', Get_delegation_token_with_signature_args, :renewer_kerberos_principal_name => renewer_kerberos_principal_name, :token_signature => token_signature) + end + + def recv_get_delegation_token_with_signature() + result = receive_message(Get_delegation_token_with_signature_result) + return result.success unless result.success.nil? + raise result.o1 unless result.o1.nil? + raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'get_delegation_token_with_signature failed: unknown result') + end + + def renew_delegation_token(token_str_form) + send_renew_delegation_token(token_str_form) + return recv_renew_delegation_token() + end + + def send_renew_delegation_token(token_str_form) + send_message('renew_delegation_token', Renew_delegation_token_args, :token_str_form => token_str_form) + end + + def recv_renew_delegation_token() + result = receive_message(Renew_delegation_token_result) + return result.success unless result.success.nil? + raise result.o1 unless result.o1.nil? + raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'renew_delegation_token failed: unknown result') + end + + def cancel_delegation_token(token_str_form) + send_cancel_delegation_token(token_str_form) + recv_cancel_delegation_token() + end + + def send_cancel_delegation_token(token_str_form) + send_message('cancel_delegation_token', Cancel_delegation_token_args, :token_str_form => token_str_form) + end + + def recv_cancel_delegation_token() + result = receive_message(Cancel_delegation_token_result) + raise result.o1 unless result.o1.nil? + return + end + end class Processor < FacebookService::Processor @@ -1539,6 +1602,50 @@ module ThriftHiveMetastore write_result(result, oprot, 'revoke_privileges', seqid) end + def process_get_delegation_token(seqid, iprot, oprot) + args = read_args(iprot, Get_delegation_token_args) + result = Get_delegation_token_result.new() + begin + result.success = @handler.get_delegation_token(args.renewer_kerberos_principal_name) + rescue MetaException => o1 + result.o1 = o1 + end + write_result(result, oprot, 'get_delegation_token', seqid) + end + + def process_get_delegation_token_with_signature(seqid, iprot, oprot) + args = read_args(iprot, Get_delegation_token_with_signature_args) + result = Get_delegation_token_with_signature_result.new() + begin + result.success = @handler.get_delegation_token_with_signature(args.renewer_kerberos_principal_name, args.token_signature) + rescue MetaException => o1 + result.o1 = o1 + end + write_result(result, oprot, 'get_delegation_token_with_signature', seqid) + end + + def process_renew_delegation_token(seqid, iprot, oprot) + args = read_args(iprot, Renew_delegation_token_args) + result = Renew_delegation_token_result.new() + begin + result.success = @handler.renew_delegation_token(args.token_str_form) + rescue MetaException => o1 + result.o1 = o1 + end + write_result(result, oprot, 'renew_delegation_token', seqid) + end + + def process_cancel_delegation_token(seqid, iprot, oprot) + args = read_args(iprot, Cancel_delegation_token_args) + result = Cancel_delegation_token_result.new() + begin + @handler.cancel_delegation_token(args.token_str_form) + rescue MetaException => o1 + result.o1 = o1 + end + write_result(result, oprot, 'cancel_delegation_token', seqid) + end + end # HELPER FUNCTIONS AND STRUCTURES @@ -3549,5 +3656,141 @@ module ThriftHiveMetastore ::Thrift::Struct.generate_accessors self end + class Get_delegation_token_args + include ::Thrift::Struct, ::Thrift::Struct_Union + RENEWER_KERBEROS_PRINCIPAL_NAME = 1 + + FIELDS = { + RENEWER_KERBEROS_PRINCIPAL_NAME => {:type => ::Thrift::Types::STRING, :name => 'renewer_kerberos_principal_name'} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class Get_delegation_token_result + include ::Thrift::Struct, ::Thrift::Struct_Union + SUCCESS = 0 + O1 = 1 + + FIELDS = { + SUCCESS => {:type => ::Thrift::Types::STRING, :name => 'success'}, + O1 => {:type => ::Thrift::Types::STRUCT, :name => 'o1', :class => MetaException} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class Get_delegation_token_with_signature_args + include ::Thrift::Struct, ::Thrift::Struct_Union + RENEWER_KERBEROS_PRINCIPAL_NAME = 1 + TOKEN_SIGNATURE = 2 + + FIELDS = { + RENEWER_KERBEROS_PRINCIPAL_NAME => {:type => ::Thrift::Types::STRING, :name => 'renewer_kerberos_principal_name'}, + TOKEN_SIGNATURE => {:type => ::Thrift::Types::STRING, :name => 'token_signature'} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class Get_delegation_token_with_signature_result + include ::Thrift::Struct, ::Thrift::Struct_Union + SUCCESS = 0 + O1 = 1 + + FIELDS = { + SUCCESS => {:type => ::Thrift::Types::STRING, :name => 'success'}, + O1 => {:type => ::Thrift::Types::STRUCT, :name => 'o1', :class => MetaException} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class Renew_delegation_token_args + include ::Thrift::Struct, ::Thrift::Struct_Union + TOKEN_STR_FORM = 1 + + FIELDS = { + TOKEN_STR_FORM => {:type => ::Thrift::Types::STRING, :name => 'token_str_form'} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class Renew_delegation_token_result + include ::Thrift::Struct, ::Thrift::Struct_Union + SUCCESS = 0 + O1 = 1 + + FIELDS = { + SUCCESS => {:type => ::Thrift::Types::I64, :name => 'success'}, + O1 => {:type => ::Thrift::Types::STRUCT, :name => 'o1', :class => MetaException} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class Cancel_delegation_token_args + include ::Thrift::Struct, ::Thrift::Struct_Union + TOKEN_STR_FORM = 1 + + FIELDS = { + TOKEN_STR_FORM => {:type => ::Thrift::Types::STRING, :name => 'token_str_form'} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class Cancel_delegation_token_result + include ::Thrift::Struct, ::Thrift::Struct_Union + O1 = 1 + + FIELDS = { + O1 => {:type => ::Thrift::Types::STRUCT, :name => 'o1', :class => MetaException} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + end diff --git metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java index d9cb457..e42c5e9 100644 --- metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java +++ metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java @@ -23,6 +23,7 @@ import static org.apache.hadoop.hive.metastore.MetaStoreUtils.DEFAULT_DATABASE_C import static org.apache.hadoop.hive.metastore.MetaStoreUtils.DEFAULT_DATABASE_NAME; import static org.apache.hadoop.hive.metastore.MetaStoreUtils.validateName; +import java.io.IOException; import java.util.ArrayList; import java.util.HashMap; import java.util.LinkedHashMap; @@ -63,10 +64,10 @@ 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.MDBPrivilege; +import org.apache.hadoop.hive.metastore.model.MGlobalPrivilege; import org.apache.hadoop.hive.metastore.model.MPartitionColumnPrivilege; import org.apache.hadoop.hive.metastore.model.MPartitionPrivilege; import org.apache.hadoop.hive.metastore.model.MRole; -import org.apache.hadoop.hive.metastore.model.MGlobalPrivilege; import org.apache.hadoop.hive.metastore.model.MRoleMap; import org.apache.hadoop.hive.metastore.model.MTableColumnPrivilege; import org.apache.hadoop.hive.metastore.model.MTablePrivilege; @@ -96,6 +97,8 @@ public class HiveMetaStore extends ThriftHiveMetastore { public static final Log LOG = LogFactory.getLog( HiveMetaStore.class); + private static HadoopThriftAuthBridge.Server saslServer; + public static class HMSHandler extends FacebookBase implements ThriftHiveMetastore.Iface { public static final Log LOG = HiveMetaStore.LOG; @@ -2812,8 +2815,94 @@ public class HiveMetaStore extends ThriftHiveMetastore { } return ret; } + @Override + public void cancel_delegation_token(String token_str_form) + throws MetaException, TException { + incrementCounter("cancel_delegation_token"); + logStartFunction("cancel_delegation_token"); + try { + HiveMetaStore.cancelDelegationToken(token_str_form); + } catch(IOException e) { + throw new MetaException(e.getMessage()); + } + + } + + @Override + public String get_delegation_token_with_signature( + String renewer_kerberos_principal_name, + String token_signature) throws MetaException, TException { + incrementCounter("get_delegation_token_with_signature"); + logStartFunction("get_delegation_token_with_signature"); + try { + return + HiveMetaStore.getDelegationToken(renewer_kerberos_principal_name, + token_signature); + } catch(IOException e) { + throw new MetaException(e.getMessage()); + } + } + + @Override + public long renew_delegation_token(String token_str_form) + throws MetaException, TException { + incrementCounter("renew_delegation_token"); + logStartFunction("renew_delegation_token"); + try { + return HiveMetaStore.renewDelegationToken(token_str_form); + } catch(IOException e) { + throw new MetaException(e.getMessage()); + } + } + + @Override + public String get_delegation_token(String renewer_kerberos_principal_name) + throws MetaException, TException { + incrementCounter("get_delegation_token_with_signature"); + logStartFunction("get_delegation_token_with_signature"); + try { + return + HiveMetaStore.getDelegationToken(renewer_kerberos_principal_name); + } catch(IOException e) { + throw new MetaException(e.getMessage()); + } + } + } + + /** + * Discard a current delegation token. + * @param tokenStrForm the token in string form + */ + public static void cancelDelegationToken(String tokenStrForm + ) throws IOException { + saslServer.cancelDelegationToken(tokenStrForm); + } + /** + * Get a new delegation token. + * @param renewer the designated renewer + * @param token_signature an identifier that is set as the service on the generated token + */ + public static String getDelegationToken(String renewer,String token_signature + )throws IOException { + return saslServer.getDelegationToken(renewer, token_signature); + } + + /** + * Get a new delegation token. + * @param renewer the designated renewer + */ + public static String getDelegationToken(String renewer)throws IOException { + return saslServer.getDelegationToken(renewer); + } + /** + * Renew a delegation token to extend its lifetime. + * @param tokenStrForm the token in string form + */ + public static long renewDelegationToken(String tokenStrForm + ) throws IOException { + return saslServer.renewDelegationToken(tokenStrForm); } - + /** * @param args */ @@ -2824,6 +2913,23 @@ public class HiveMetaStore extends ThriftHiveMetastore { port = new Integer(args[0]); } try { + startMetaStore(port, ShimLoader.getHadoopThriftAuthBridge()); + } catch (Throwable t) { + HMSHandler.LOG + .error("Metastore Thrift Server threw an exception. Exiting..."); + System.exit(1); + } + } + + /** + * Start Metastore based on a passed {@link HadoopThriftAuthBridge} + * @param port + * @param bridge + * @throws Throwable + */ + public static void startMetaStore(int port, HadoopThriftAuthBridge bridge) + throws Throwable { + try { HMSHandler handler = new HMSHandler("new db based metaserver"); HiveConf conf = handler.getHiveConf(); @@ -2842,11 +2948,14 @@ public class HiveMetaStore extends ThriftHiveMetastore { TProcessor processor = new ThriftHiveMetastore.Processor(handler); TTransportFactory transFactory; if (useSasl) { - HadoopThriftAuthBridge.Server authBridge = ShimLoader.getHadoopThriftAuthBridge().createServer( + saslServer = bridge.createServer( conf.getVar(HiveConf.ConfVars.METASTORE_KERBEROS_KEYTAB_FILE), conf.getVar(HiveConf.ConfVars.METASTORE_KERBEROS_PRINCIPAL)); - transFactory = authBridge.createTransportFactory(); - processor = authBridge.wrapProcessor(processor); + + // start delegation token manager + saslServer.startDelegationTokenSecretManager(conf); + transFactory = saslServer.createTransportFactory(); + processor = saslServer.wrapProcessor(processor); } else { transFactory = new TTransportFactory(); } @@ -2854,7 +2963,7 @@ public class HiveMetaStore extends ThriftHiveMetastore { TThreadPoolServer.Options options = new TThreadPoolServer.Options(); options.minWorkerThreads = minWorkerThreads; options.maxWorkerThreads = maxWorkerThreads; - TServer server = new TThreadPoolServer(processor, serverTransport, + TServer tServer = new TThreadPoolServer(processor, serverTransport, transFactory, transFactory, new TBinaryProtocol.Factory(), new TBinaryProtocol.Factory(), options); HMSHandler.LOG.info("Started the new metaserver on port [" + port @@ -2864,14 +2973,11 @@ public class HiveMetaStore extends ThriftHiveMetastore { HMSHandler.LOG.info("Options.maxWorkerThreads = " + options.maxWorkerThreads); HMSHandler.LOG.info("TCP keepalive = " + tcpKeepAlive); - - server.serve(); + tServer.serve(); } catch (Throwable x) { x.printStackTrace(); - HMSHandler.LOG - .error("Metastore Thrift Server threw an exception. Exiting..."); HMSHandler.LOG.error(StringUtils.stringifyException(x)); - System.exit(1); + throw x; } } } diff --git metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java index aa739e3..539e5e5 100644 --- metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java +++ metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java @@ -78,6 +78,8 @@ public class HiveMetaStoreClient implements IMetaStoreClient { private final boolean standAloneClient = false; private final HiveMetaHookLoader hookLoader; private final HiveConf conf; + private String tokenStrForm; + private final boolean localMetaStore; // for thrift connects private int retries = 5; @@ -99,7 +101,7 @@ public class HiveMetaStoreClient implements IMetaStoreClient { } this.conf = conf; - boolean localMetaStore = conf.getBoolean("hive.metastore.local", false); + localMetaStore = conf.getBoolean("hive.metastore.local", false); if (localMetaStore) { // instantiate the metastore server handler directly instead of connecting // through the network @@ -205,9 +207,26 @@ public class HiveMetaStoreClient implements IMetaStoreClient { try { HadoopThriftAuthBridge.Client authBridge = ShimLoader.getHadoopThriftAuthBridge().createClient(); - String principalConfig = conf.getVar(HiveConf.ConfVars.METASTORE_KERBEROS_PRINCIPAL); - transport = authBridge.createClientTransport( - principalConfig, store.getHost(), "KERBEROS", transport); + + // check if we should use delegation tokens to authenticate + // the call below gets hold of the tokens if they are set up by hadoop + // this should happen on the map/reduce tasks if the client added the + // tokens into hadoop's credential store in the front end during job + // submission. + String tokenSig = conf.get("hive.metastore.token.signature"); + // tokenSig could be null + tokenStrForm = ShimLoader.getHadoopShims().getTokenStrForm(tokenSig); + + if(tokenStrForm != null) { + // authenticate using delegation tokens via the "DIGEST" mechanism + transport = authBridge.createClientTransport(null, store.getHost(), + "DIGEST", tokenStrForm, transport); + } else { + String principalConfig = conf.getVar(HiveConf.ConfVars.METASTORE_KERBEROS_PRINCIPAL); + transport = authBridge.createClientTransport( + principalConfig, store.getHost(), "KERBEROS", null, + transport); + } } catch (IOException ioe) { LOG.error("Couldn't create client transport", ioe); throw new MetaException(ioe.toString()); @@ -234,6 +253,10 @@ public class HiveMetaStoreClient implements IMetaStoreClient { } } + public String getTokenStrForm() throws IOException { + return tokenStrForm; + } + public void close() { isConnected = false; if ((transport != null) && transport.isOpen()) { @@ -1021,6 +1044,46 @@ public class HiveMetaStoreClient implements IMetaStoreClient { return client.list_privileges(principalName, principalType, hiveObject); } + @Override + public String getDelegationTokenWithSignature(String renewerKerberosPrincipalName, + String tokenSignature) throws + MetaException, TException { + if(localMetaStore) { + throw new UnsupportedOperationException("getDelegationToken() can be " + + "called only in thrift (non local) mode"); + } + return client.get_delegation_token_with_signature(renewerKerberosPrincipalName, tokenSignature); + } + + @Override + public String getDelegationToken(String renewerKerberosPrincipalName) throws + MetaException, TException { + if(localMetaStore) { + throw new UnsupportedOperationException("getDelegationToken() can be " + + "called only in thrift (non local) mode"); + } + return client.get_delegation_token(renewerKerberosPrincipalName); + } + + @Override + public long renewDelegationToken(String tokenStrForm) throws MetaException, TException { + if(localMetaStore) { + throw new UnsupportedOperationException("renewDelegationToken() can be " + + "called only in thrift (non local) mode"); + } + return client.renew_delegation_token(tokenStrForm); + + } + + @Override + public void cancelDelegationToken(String tokenStrForm) throws MetaException, TException { + if(localMetaStore) { + throw new UnsupportedOperationException("renewDelegationToken() can be " + + "called only in thrift (non local) mode"); + } + client.cancel_delegation_token(tokenStrForm); + } + /** * Creates a synchronized wrapper for any {@link IMetaStoreClient}. * This may be used by multi-threaded applications until we have diff --git metastore/src/java/org/apache/hadoop/hive/metastore/IMetaStoreClient.java metastore/src/java/org/apache/hadoop/hive/metastore/IMetaStoreClient.java index 3a1ccf6..9542126 100644 --- metastore/src/java/org/apache/hadoop/hive/metastore/IMetaStoreClient.java +++ metastore/src/java/org/apache/hadoop/hive/metastore/IMetaStoreClient.java @@ -637,4 +637,39 @@ public interface IMetaStoreClient { public boolean revoke_privileges(PrivilegeBag privileges) throws MetaException, TException; + /** + * @param renewerKerberosPrincipalName + * @param tokenSignature + * @return + * @throws MetaException + * @throws TException + */ + public String getDelegationTokenWithSignature(String renewerKerberosPrincipalName, String tokenSignature) + throws MetaException, TException; + + /** + * @param renewerKerberosPrincipalName + * @return + * @throws MetaException + * @throws TException + */ + public String getDelegationToken(String renewerKerberosPrincipalName) + throws MetaException, TException; + + /** + * @param tokenStrForm + * @return + * @throws MetaException + * @throws TException + */ + public long renewDelegationToken(String tokenStrForm) throws MetaException, TException; + + /** + * @param tokenStrForm + * @throws MetaException + * @throws TException + */ + public void cancelDelegationToken(String tokenStrForm) throws MetaException, TException; + + } diff --git service/src/gen/thrift/gen-py/hive_service/ThriftHive-remote service/src/gen/thrift/gen-py/hive_service/ThriftHive-remote old mode 100644 new mode 100755 diff --git shims/build.xml shims/build.xml index 602f3df..2021cfb 100644 --- shims/build.xml +++ shims/build.xml @@ -26,6 +26,10 @@ to call at top-level: ant deploy-contrib compile-core-test + + + + @@ -33,10 +37,7 @@ to call at top-level: ant deploy-contrib compile-core-test - - - - + - - - - + + + + + + + + + + + + + + + + + + - diff --git shims/src/0.20/java/org/apache/hadoop/hive/shims/Hadoop20Shims.java shims/src/0.20/java/org/apache/hadoop/hive/shims/Hadoop20Shims.java index 981377f..db96e7f 100644 --- shims/src/0.20/java/org/apache/hadoop/hive/shims/Hadoop20Shims.java +++ shims/src/0.20/java/org/apache/hadoop/hive/shims/Hadoop20Shims.java @@ -449,4 +449,9 @@ public class Hadoop20Shims implements HadoopShims { } return ugi; } + + @Override + public String getTokenStrForm(String tokenSignature) throws IOException { + throw new UnsupportedOperationException("Tokens are not supported in current hadoop version"); + } } diff --git shims/src/0.20S/java/org/apache/hadoop/hive/shims/Hadoop20SShims.java shims/src/0.20S/java/org/apache/hadoop/hive/shims/Hadoop20SShims.java index deb7c0f..a8f0cb0 100644 --- shims/src/0.20S/java/org/apache/hadoop/hive/shims/Hadoop20SShims.java +++ shims/src/0.20S/java/org/apache/hadoop/hive/shims/Hadoop20SShims.java @@ -23,7 +23,6 @@ import java.io.IOException; import java.lang.reflect.Constructor; import java.util.ArrayList; import java.util.List; -import javax.security.auth.login.LoginException; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileStatus; @@ -31,6 +30,7 @@ import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.fs.PathFilter; import org.apache.hadoop.hdfs.MiniDFSCluster; +import org.apache.hadoop.hive.thrift.DelegationTokenSelector; import org.apache.hadoop.io.Text; import org.apache.hadoop.io.WritableComparable; import org.apache.hadoop.mapred.FileInputFormat; @@ -50,6 +50,9 @@ import org.apache.hadoop.mapred.lib.CombineFileInputFormat; import org.apache.hadoop.mapred.lib.CombineFileSplit; import org.apache.hadoop.mapred.lib.NullOutputFormat; import org.apache.hadoop.security.UserGroupInformation; +import org.apache.hadoop.security.token.Token; +import org.apache.hadoop.security.token.TokenIdentifier; +import org.apache.hadoop.security.token.TokenSelector; import org.apache.hadoop.tools.HadoopArchives; import org.apache.hadoop.util.ToolRunner; @@ -443,4 +446,14 @@ public class Hadoop20SShims implements HadoopShims { public UserGroupInformation getUGIForConf(Configuration conf) throws IOException { return UserGroupInformation.getCurrentUser(); } + + @Override + public String getTokenStrForm(String tokenSignature) throws IOException { + UserGroupInformation ugi = UserGroupInformation.getCurrentUser(); + TokenSelector tokenSelector = new DelegationTokenSelector(); + + Token token = tokenSelector.selectToken( + tokenSignature == null ? new Text() : new Text(tokenSignature), ugi.getTokens()); + return token != null ? token.encodeToUrlString() : null; + } } diff --git shims/src/0.20S/java/org/apache/hadoop/hive/thrift/DelegationTokenIdentifier.java shims/src/0.20S/java/org/apache/hadoop/hive/thrift/DelegationTokenIdentifier.java new file mode 100644 index 0000000..4ca3c0b --- /dev/null +++ shims/src/0.20S/java/org/apache/hadoop/hive/thrift/DelegationTokenIdentifier.java @@ -0,0 +1,52 @@ +/** + * 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.thrift; + +import org.apache.hadoop.io.Text; +import org.apache.hadoop.security.token.delegation.AbstractDelegationTokenIdentifier; + +/** + * A delegation token identifier that is specific to Hive. + */ +public class DelegationTokenIdentifier + extends AbstractDelegationTokenIdentifier { + public static final Text HIVE_DELEGATION_KIND = new Text("HIVE_DELEGATION_TOKEN"); + + /** + * Create an empty delegation token identifier for reading into. + */ + public DelegationTokenIdentifier() { + } + + /** + * Create a new delegation token identifier + * @param owner the effective username of the token owner + * @param renewer the username of the renewer + * @param realUser the real username of the token owner + */ + public DelegationTokenIdentifier(Text owner, Text renewer, Text realUser) { + super(owner, renewer, realUser); + } + + @Override + public Text getKind() { + return HIVE_DELEGATION_KIND; + } + +} diff --git shims/src/0.20S/java/org/apache/hadoop/hive/thrift/DelegationTokenSecretManager.java shims/src/0.20S/java/org/apache/hadoop/hive/thrift/DelegationTokenSecretManager.java new file mode 100644 index 0000000..0e048c7 --- /dev/null +++ shims/src/0.20S/java/org/apache/hadoop/hive/thrift/DelegationTokenSecretManager.java @@ -0,0 +1,94 @@ +/** + * 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.thrift; + +import java.io.IOException; + +import org.apache.hadoop.io.Text; +import org.apache.hadoop.security.UserGroupInformation; +import org.apache.hadoop.security.token.Token; +import org.apache.hadoop.security.token.delegation.AbstractDelegationTokenSecretManager; + +/** + * A Hive specific delegation token secret manager. + * The secret manager is responsible for generating and accepting the password + * for each token. + */ +public class DelegationTokenSecretManager + extends AbstractDelegationTokenSecretManager { + + /** + * Create a secret manager + * @param delegationKeyUpdateInterval the number of seconds for rolling new + * secret keys. + * @param delegationTokenMaxLifetime the maximum lifetime of the delegation + * tokens + * @param delegationTokenRenewInterval how often the tokens must be renewed + * @param delegationTokenRemoverScanInterval how often the tokens are scanned + * for expired tokens + */ + public DelegationTokenSecretManager(long delegationKeyUpdateInterval, + long delegationTokenMaxLifetime, + long delegationTokenRenewInterval, + long delegationTokenRemoverScanInterval) { + super(delegationKeyUpdateInterval, delegationTokenMaxLifetime, + delegationTokenRenewInterval, delegationTokenRemoverScanInterval); + } + + @Override + public DelegationTokenIdentifier createIdentifier() { + return new DelegationTokenIdentifier(); + } + + public synchronized void cancelDelegationToken(String tokenStrForm) throws IOException { + Token t= new Token(); + t.decodeFromUrlString(tokenStrForm); + String user = UserGroupInformation.getCurrentUser().getUserName(); + cancelToken(t, user); + } + + public synchronized long renewDelegationToken(String tokenStrForm) throws IOException { + Token t= new Token(); + t.decodeFromUrlString(tokenStrForm); + String user = UserGroupInformation.getCurrentUser().getUserName(); + return renewToken(t, user); + } + + public synchronized String getDelegationToken(String renewer, String tokenSignature) throws IOException { + UserGroupInformation ugi = UserGroupInformation.getCurrentUser(); + Text owner = new Text(ugi.getUserName()); + Text realUser = null; + if (ugi.getRealUser() != null) { + realUser = new Text(ugi.getRealUser().getUserName()); + } + DelegationTokenIdentifier ident = + new DelegationTokenIdentifier(owner, new Text(renewer), realUser); + Token t = new Token( + ident, this); + if(tokenSignature != null) { + t.setService(new Text(tokenSignature)); + } + return t.encodeToUrlString(); + } + + public synchronized String getDelegationToken(String renewer) throws IOException { + return getDelegationToken(renewer, null); + } +} + diff --git shims/src/0.20S/java/org/apache/hadoop/hive/thrift/DelegationTokenSelector.java shims/src/0.20S/java/org/apache/hadoop/hive/thrift/DelegationTokenSelector.java new file mode 100644 index 0000000..f6e2420 --- /dev/null +++ shims/src/0.20S/java/org/apache/hadoop/hive/thrift/DelegationTokenSelector.java @@ -0,0 +1,33 @@ +/** + * 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.thrift; + +import org.apache.hadoop.security.token.delegation.AbstractDelegationTokenSelector; + +/** + * A delegation token that is specialized for Hive + */ + +public class DelegationTokenSelector + extends AbstractDelegationTokenSelector{ + + public DelegationTokenSelector() { + super(DelegationTokenIdentifier.HIVE_DELEGATION_KIND); + } +} diff --git shims/src/0.20S/java/org/apache/hadoop/hive/thrift/HadoopThriftAuthBridge20S.java shims/src/0.20S/java/org/apache/hadoop/hive/thrift/HadoopThriftAuthBridge20S.java index b60e500..fd042c7 100644 --- shims/src/0.20S/java/org/apache/hadoop/hive/thrift/HadoopThriftAuthBridge20S.java +++ shims/src/0.20S/java/org/apache/hadoop/hive/thrift/HadoopThriftAuthBridge20S.java @@ -15,21 +15,34 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - package org.apache.hadoop.hive.thrift; - import java.io.IOException; +import java.io.IOException; import java.security.PrivilegedAction; import java.security.PrivilegedExceptionAction; +import javax.security.auth.callback.Callback; +import javax.security.auth.callback.CallbackHandler; +import javax.security.auth.callback.NameCallback; +import javax.security.auth.callback.PasswordCallback; +import javax.security.auth.callback.UnsupportedCallbackException; +import javax.security.sasl.AuthorizeCallback; +import javax.security.sasl.RealmCallback; +import javax.security.sasl.RealmChoiceCallback; import javax.security.sasl.SaslException; +import javax.security.sasl.SaslServer; +import org.apache.commons.codec.binary.Base64; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.security.SaslRpcServer; import org.apache.hadoop.security.SecurityUtil; import org.apache.hadoop.security.UserGroupInformation; import org.apache.hadoop.security.SaslRpcServer.AuthMethod; +import org.apache.hadoop.security.token.Token; +import org.apache.hadoop.security.token.TokenIdentifier; +import org.apache.hadoop.security.token.SecretManager.InvalidToken; import org.apache.thrift.TException; import org.apache.thrift.TProcessor; import org.apache.thrift.protocol.TProtocol; @@ -66,14 +79,27 @@ import org.apache.thrift.transport.TTransportFactory; * @param serverPrincipal The Kerberos principal of the target server. * @param underlyingTransport The underlying transport mechanism, usually a TSocket. */ + @Override public TTransport createClientTransport( String principalConfig, String host, - String methodStr, TTransport underlyingTransport) + String methodStr, String tokenStrForm, TTransport underlyingTransport) throws IOException { AuthMethod method = AuthMethod.valueOf(AuthMethod.class, methodStr); + TTransport saslTransport = null; switch (method) { + case DIGEST: + Token t= new Token(); + t.decodeFromUrlString(tokenStrForm); + saslTransport = new TSaslClientTransport( + method.getMechanismName(), + null, + null, SaslRpcServer.SASL_DEFAULT_REALM, + SaslRpcServer.SASL_PROPS, new SaslClientCallbackHandler(t), + underlyingTransport); + return new TUGIAssumingTransport(saslTransport, UserGroupInformation.getCurrentUser()); + case KERBEROS: String serverPrincipal = SecurityUtil.getServerPrincipal(principalConfig, host); String names[] = SaslRpcServer.splitKerberosName(serverPrincipal); @@ -83,7 +109,7 @@ import org.apache.thrift.transport.TTransportFactory; + serverPrincipal); } try { - TTransport saslTransport = new TSaslClientTransport( + saslTransport = new TSaslClientTransport( method.getMechanismName(), null, names[0], names[1], @@ -95,16 +121,219 @@ import org.apache.thrift.transport.TTransportFactory; } default: - throw new IOException("Unsupported authentication method: " +method); + throw new IOException("Unsupported authentication method: " + method); + } + } + private static class SaslClientCallbackHandler implements CallbackHandler { + private final String userName; + private final char[] userPassword; + + public SaslClientCallbackHandler(Token token) { + this.userName = encodeIdentifier(token.getIdentifier()); + this.userPassword = encodePassword(token.getPassword()); + } + + public void handle(Callback[] callbacks) + throws UnsupportedCallbackException { + NameCallback nc = null; + PasswordCallback pc = null; + RealmCallback rc = null; + for (Callback callback : callbacks) { + if (callback instanceof RealmChoiceCallback) { + continue; + } else if (callback instanceof NameCallback) { + nc = (NameCallback) callback; + } else if (callback instanceof PasswordCallback) { + pc = (PasswordCallback) callback; + } else if (callback instanceof RealmCallback) { + rc = (RealmCallback) callback; + } else { + throw new UnsupportedCallbackException(callback, + "Unrecognized SASL client callback"); + } + } + if (nc != null) { + if (LOG.isDebugEnabled()) { + LOG.debug("SASL client callback: setting username: " + userName); + } + nc.setName(userName); + } + if (pc != null) { + if (LOG.isDebugEnabled()) { + LOG.debug("SASL client callback: setting userPassword"); + } + pc.setPassword(userPassword); + } + if (rc != null) { + if (LOG.isDebugEnabled()) { + LOG.debug("SASL client callback: setting realm: " + + rc.getDefaultText()); + } + rc.setText(rc.getDefaultText()); + } + } + + static String encodeIdentifier(byte[] identifier) { + return new String(Base64.encodeBase64(identifier)); + } + + static char[] encodePassword(byte[] password) { + return new String(Base64.encodeBase64(password)).toCharArray(); + } + } + /** + * The Thrift SASL transports call Sasl.createSaslServer and Sasl.createSaslClient + * inside open(). So, we need to assume the correct UGI when the transport is opened + * so that the SASL mechanisms have access to the right principal. This transport + * wraps the Sasl transports to set up the right UGI context for open(). + * + * This is used on the client side, where the API explicitly opens a transport to + * the server. + */ + private static class TUGIAssumingTransport extends TFilterTransport { + private final UserGroupInformation ugi; + + public TUGIAssumingTransport(TTransport wrapped, UserGroupInformation ugi) { + super(wrapped); + this.ugi = ugi; + } + + @Override + public void open() throws TTransportException { + try { + ugi.doAs(new PrivilegedExceptionAction() { + public Void run() { + try { + wrapped.open(); + } catch (TTransportException tte) { + // Wrap the transport exception in an RTE, since UGI.doAs() then goes + // and unwraps this for us out of the doAs block. We then unwrap one + // more time in our catch clause to get back the TTE. (ugh) + throw new RuntimeException(tte); + } + return null; + } + }); + } catch (IOException ioe) { + assert false : "Never thrown!"; + throw new RuntimeException("Received an ioe we never threw!", ioe); + } catch (InterruptedException ie) { + assert false : "We never expect to see an InterruptedException thrown in this block"; + throw new RuntimeException("Received an ie we never threw!", ie); + } catch (RuntimeException rte) { + if (rte.getCause() instanceof TTransportException) { + throw (TTransportException)rte.getCause(); + } else { + throw rte; + } + } + } + } + /** + * Transport that simply wraps another transport. + * This is the equivalent of FilterInputStream for Thrift transports. + */ + private static class TFilterTransport extends TTransport { + protected final TTransport wrapped; + + public TFilterTransport(TTransport wrapped) { + this.wrapped = wrapped; + } + + @Override + public void open() throws TTransportException { + wrapped.open(); + } + + @Override + public boolean isOpen() { + return wrapped.isOpen(); + } + + @Override + public boolean peek() { + return wrapped.peek(); + } + + @Override + public void close() { + wrapped.close(); + } + + @Override + public int read(byte[] buf, int off, int len) throws TTransportException { + return wrapped.read(buf, off, len); + } + + @Override + public int readAll(byte[] buf, int off, int len) throws TTransportException { + return wrapped.readAll(buf, off, len); + } + + @Override + public void write(byte[] buf) throws TTransportException { + wrapped.write(buf); + } + + @Override + public void write(byte[] buf, int off, int len) throws TTransportException { + wrapped.write(buf, off, len); + } + + @Override + public void flush() throws TTransportException { + wrapped.flush(); + } + + @Override + public byte[] getBuffer() { + return wrapped.getBuffer(); + } + + @Override + public int getBufferPosition() { + return wrapped.getBufferPosition(); + } + + @Override + public int getBytesRemainingInBuffer() { + return wrapped.getBytesRemainingInBuffer(); + } + + @Override + public void consumeBuffer(int len) { + wrapped.consumeBuffer(len); } } } public static class Server extends HadoopThriftAuthBridge.Server { - private final UserGroupInformation realUgi; - + final UserGroupInformation realUgi; + DelegationTokenSecretManager secretManager; + private final static long DELEGATION_TOKEN_GC_INTERVAL = 3600000; // 1 hour + //Delegation token related keys + public static final String DELEGATION_KEY_UPDATE_INTERVAL_KEY = + "hive.cluster.delegation.key.update-interval"; + public static final long DELEGATION_KEY_UPDATE_INTERVAL_DEFAULT = + 24*60*60*1000; // 1 day + public static final String DELEGATION_TOKEN_RENEW_INTERVAL_KEY = + "hive.cluster.delegation.token.renew-interval"; + public static final long DELEGATION_TOKEN_RENEW_INTERVAL_DEFAULT = + 24*60*60*1000; // 1 day + public static final String DELEGATION_TOKEN_MAX_LIFETIME_KEY = + "hive.cluster.delegation.token.max-lifetime"; + public static final long DELEGATION_TOKEN_MAX_LIFETIME_DEFAULT = + 7*24*60*60*1000; // 7 days + + public Server() throws TTransportException { + try { + realUgi = UserGroupInformation.getCurrentUser(); + } catch (IOException ioe) { + throw new TTransportException(ioe); + } + } /** - * TODO: javadoc + * Create a server with a kerberos keytab/principal. */ private Server(String keytabFile, String principalConf) throws TTransportException { @@ -143,7 +372,7 @@ import org.apache.thrift.transport.TTransportFactory; String kerberosName = realUgi.getUserName(); final String names[] = SaslRpcServer.splitKerberosName(kerberosName); if (names.length != 3) { - throw new TTransportException("Kerberos principal should have 3 parts: " +kerberosName); + throw new TTransportException("Kerberos principal should have 3 parts: " + kerberosName); } TSaslServerTransport.Factory transFactory = new TSaslServerTransport.Factory(); @@ -152,6 +381,9 @@ import org.apache.thrift.transport.TTransportFactory; names[0], names[1], // two parts of kerberos principal SaslRpcServer.SASL_PROPS, new SaslRpcServer.SaslGssCallbackHandler()); + transFactory.addServerDefinition(AuthMethod.DIGEST.getMechanismName(), + null, SaslRpcServer.SASL_DEFAULT_REALM, + SaslRpcServer.SASL_PROPS, new SaslDigestCallbackHandler(secretManager)); return new TUGIAssumingTransportFactory(transFactory, realUgi); } @@ -163,7 +395,123 @@ import org.apache.thrift.transport.TTransportFactory; */ @Override public TProcessor wrapProcessor(TProcessor processor) { - return new TUGIAssumingProcessor(processor); + return new TUGIAssumingProcessor(processor, secretManager); + } + + @Override + public void startDelegationTokenSecretManager(Configuration conf) + throws IOException{ + long secretKeyInterval = + conf.getLong(DELEGATION_KEY_UPDATE_INTERVAL_KEY, + DELEGATION_KEY_UPDATE_INTERVAL_DEFAULT); + long tokenMaxLifetime = + conf.getLong(DELEGATION_TOKEN_MAX_LIFETIME_KEY, + DELEGATION_TOKEN_MAX_LIFETIME_DEFAULT); + long tokenRenewInterval = + conf.getLong(DELEGATION_TOKEN_RENEW_INTERVAL_KEY, + DELEGATION_TOKEN_RENEW_INTERVAL_DEFAULT); + secretManager = + new DelegationTokenSecretManager(secretKeyInterval, + tokenMaxLifetime, + tokenRenewInterval, + DELEGATION_TOKEN_GC_INTERVAL); + secretManager.startThreads(); + } + + @Override + public String getDelegationToken(String renewer) throws IOException { + return secretManager.getDelegationToken(renewer); + } + + @Override + public long renewDelegationToken(String tokenStrForm) throws IOException { + return secretManager.renewDelegationToken(tokenStrForm); + } + + @Override + public String getDelegationToken(String renewer, String token_signature) + throws IOException { + return secretManager.getDelegationToken(renewer, token_signature); + } + + @Override + public void cancelDelegationToken(String tokenStrForm) throws IOException { + secretManager.cancelDelegationToken(tokenStrForm); + } + + + /** CallbackHandler for SASL DIGEST-MD5 mechanism */ + // This code is pretty much completely based on Hadoop's + // SaslRpcServer.SaslDigestCallbackHandler - the only reason we could not + // use that Hadoop class as-is was because it needs a Server.Connection object + // which is relevant in hadoop rpc but not here in the metastore - so the + // code below does not deal with the Connection Server.object. + static class SaslDigestCallbackHandler implements CallbackHandler { + private final DelegationTokenSecretManager secretManager; + + public SaslDigestCallbackHandler( + DelegationTokenSecretManager secretManager) { + this.secretManager = secretManager; + } + + private char[] getPassword(DelegationTokenIdentifier tokenid) throws InvalidToken { + return encodePassword(secretManager.retrievePassword(tokenid)); + } + + private char[] encodePassword(byte[] password) { + return new String(Base64.encodeBase64(password)).toCharArray(); + } + /** {@inheritDoc} */ + @Override + public void handle(Callback[] callbacks) throws InvalidToken, + UnsupportedCallbackException { + NameCallback nc = null; + PasswordCallback pc = null; + AuthorizeCallback ac = null; + for (Callback callback : callbacks) { + if (callback instanceof AuthorizeCallback) { + ac = (AuthorizeCallback) callback; + } else if (callback instanceof NameCallback) { + nc = (NameCallback) callback; + } else if (callback instanceof PasswordCallback) { + pc = (PasswordCallback) callback; + } else if (callback instanceof RealmCallback) { + continue; // realm is ignored + } else { + throw new UnsupportedCallbackException(callback, + "Unrecognized SASL DIGEST-MD5 Callback"); + } + } + if (pc != null) { + DelegationTokenIdentifier tokenIdentifier = SaslRpcServer. + getIdentifier(nc.getDefaultName(), secretManager); + char[] password = getPassword(tokenIdentifier); + + if (LOG.isDebugEnabled()) { + LOG.debug("SASL server DIGEST-MD5 callback: setting password " + + "for client: " + tokenIdentifier.getUser()); + } + pc.setPassword(password); + } + if (ac != null) { + String authid = ac.getAuthenticationID(); + String authzid = ac.getAuthorizationID(); + if (authid.equals(authzid)) { + ac.setAuthorized(true); + } else { + ac.setAuthorized(false); + } + if (ac.isAuthorized()) { + if (LOG.isDebugEnabled()) { + String username = + SaslRpcServer.getIdentifier(authzid, secretManager).getUser().getUserName(); + LOG.debug("SASL server DIGEST-MD5 callback: setting " + + "canonicalized client ID: " + username); + } + ac.setAuthorizedID(authzid); + } + } + } } /** @@ -175,22 +523,35 @@ import org.apache.thrift.transport.TTransportFactory; */ private class TUGIAssumingProcessor implements TProcessor { final TProcessor wrapped; - - TUGIAssumingProcessor(TProcessor wrapped) { + DelegationTokenSecretManager secretManager; + TUGIAssumingProcessor(TProcessor wrapped, DelegationTokenSecretManager secretManager) { this.wrapped = wrapped; + this.secretManager = secretManager; } public boolean process(final TProtocol inProt, final TProtocol outProt) throws TException { TTransport trans = inProt.getTransport(); if (!(trans instanceof TSaslServerTransport)) { - throw new TException("Unexpected non-SASL transport " +trans.getClass()); + throw new TException("Unexpected non-SASL transport " + trans.getClass()); } TSaslServerTransport saslTrans = (TSaslServerTransport)trans; - String authId = saslTrans.getSaslServer().getAuthorizationID(); + SaslServer saslServer = saslTrans.getSaslServer(); + String authId = saslServer.getAuthorizationID(); + LOG.debug("AUTH ID ======>" + authId); + String endUser = authId; + if(saslServer.getMechanismName().equals("DIGEST-MD5")) { + try { + TokenIdentifier tokenId = SaslRpcServer.getIdentifier(authId, + secretManager); + endUser = tokenId.getUser().getUserName(); + } catch (InvalidToken e) { + throw new TException(e.getMessage()); + } + } try { UserGroupInformation clientUgi = UserGroupInformation.createProxyUser( - authId, UserGroupInformation.getLoginUser()); + endUser, UserGroupInformation.getLoginUser()); return clientUgi.doAs(new PrivilegedExceptionAction() { public Boolean run() { try { @@ -213,160 +574,33 @@ import org.apache.thrift.transport.TTransportFactory; } } - } - - /** - * A TransportFactory that wraps another one, but assumes a specified UGI - * before calling through. - * - * This is used on the server side to assume the server's Principal when accepting - * clients. - */ - private static class TUGIAssumingTransportFactory extends TTransportFactory { - private final UserGroupInformation ugi; - private final TTransportFactory wrapped; - - public TUGIAssumingTransportFactory(TTransportFactory wrapped, UserGroupInformation ugi) { - assert wrapped != null; - assert ugi != null; - - this.wrapped = wrapped; - this.ugi = ugi; - } + /** + * A TransportFactory that wraps another one, but assumes a specified UGI + * before calling through. + * + * This is used on the server side to assume the server's Principal when accepting + * clients. + */ + static class TUGIAssumingTransportFactory extends TTransportFactory { + private final UserGroupInformation ugi; + private final TTransportFactory wrapped; - @Override - public TTransport getTransport(final TTransport trans) { - return ugi.doAs(new PrivilegedAction() { - public TTransport run() { - return wrapped.getTransport(trans); - } - }); - } - } + public TUGIAssumingTransportFactory(TTransportFactory wrapped, UserGroupInformation ugi) { + assert wrapped != null; + assert ugi != null; - /** - * The Thrift SASL transports call Sasl.createSaslServer and Sasl.createSaslClient - * inside open(). So, we need to assume the correct UGI when the transport is opened - * so that the SASL mechanisms have access to the right principal. This transport - * wraps the Sasl transports to set up the right UGI context for open(). - * - * This is used on the client side, where the API explicitly opens a transport to - * the server. - */ - private static class TUGIAssumingTransport extends TFilterTransport { - private final UserGroupInformation ugi; - - public TUGIAssumingTransport(TTransport wrapped, UserGroupInformation ugi) { - super(wrapped); - this.ugi = ugi; - } + this.wrapped = wrapped; + this.ugi = ugi; + } - @Override - public void open() throws TTransportException { - try { - ugi.doAs(new PrivilegedExceptionAction() { - public Void run() { - try { - wrapped.open(); - } catch (TTransportException tte) { - // Wrap the transport exception in an RTE, since UGI.doAs() then goes - // and unwraps this for us out of the doAs block. We then unwrap one - // more time in our catch clause to get back the TTE. (ugh) - throw new RuntimeException(tte); - } - return null; + @Override + public TTransport getTransport(final TTransport trans) { + return ugi.doAs(new PrivilegedAction() { + public TTransport run() { + return wrapped.getTransport(trans); } }); - } catch (IOException ioe) { - assert false : "Never thrown!"; - throw new RuntimeException("Received an ioe we never threw!", ioe); - } catch (InterruptedException ie) { - assert false : "We never expect to see an InterruptedException thrown in this block"; - throw new RuntimeException("Received an ie we never threw!", ie); - } catch (RuntimeException rte) { - if (rte.getCause() instanceof TTransportException) { - throw (TTransportException)rte.getCause(); - } else { - throw rte; - } } } } - - /** - * Transport that simply wraps another transport. - * This is the equivalent of FilterInputStream for Thrift transports. - */ - private static class TFilterTransport extends TTransport { - protected final TTransport wrapped; - - public TFilterTransport(TTransport wrapped) { - this.wrapped = wrapped; - } - - @Override - public void open() throws TTransportException { - wrapped.open(); - } - - @Override - public boolean isOpen() { - return wrapped.isOpen(); - } - - @Override - public boolean peek() { - return wrapped.peek(); - } - - @Override - public void close() { - wrapped.close(); - } - - @Override - public int read(byte[] buf, int off, int len) throws TTransportException { - return wrapped.read(buf, off, len); - } - - @Override - public int readAll(byte[] buf, int off, int len) throws TTransportException { - return wrapped.readAll(buf, off, len); - } - - @Override - public void write(byte[] buf) throws TTransportException { - wrapped.write(buf); - } - - @Override - public void write(byte[] buf, int off, int len) throws TTransportException { - wrapped.write(buf, off, len); - } - - @Override - public void flush() throws TTransportException { - wrapped.flush(); - } - - @Override - public byte[] getBuffer() { - return wrapped.getBuffer(); - } - - @Override - public int getBufferPosition() { - return wrapped.getBufferPosition(); - } - - @Override - public int getBytesRemainingInBuffer() { - return wrapped.getBytesRemainingInBuffer(); - } - - @Override - public void consumeBuffer(int len) { - wrapped.consumeBuffer(len); - } - } } diff --git shims/src/common/java/org/apache/hadoop/hive/shims/HadoopShims.java shims/src/common/java/org/apache/hadoop/hive/shims/HadoopShims.java index ee3faf0..4f2032e 100644 --- shims/src/common/java/org/apache/hadoop/hive/shims/HadoopShims.java +++ shims/src/common/java/org/apache/hadoop/hive/shims/HadoopShims.java @@ -21,6 +21,10 @@ import java.io.DataInput; import java.io.DataOutput; import java.io.IOException; +import javax.security.auth.login.LoginException; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileStatus; import org.apache.hadoop.fs.FileSystem; @@ -35,10 +39,6 @@ import org.apache.hadoop.mapred.Reporter; import org.apache.hadoop.mapred.RunningJob; import org.apache.hadoop.mapred.TaskCompletionEvent; import org.apache.hadoop.security.UserGroupInformation; -import javax.security.auth.login.LoginException; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; /** * In order to be compatible with multiple versions of Hadoop, all parts @@ -158,6 +158,24 @@ public interface HadoopShims { */ public UserGroupInformation getUGIForConf(Configuration conf) throws LoginException, IOException; + + /** + * Get the string form of the token given a token signature. + * The signature is used as the value of the "service" field in the token for lookup. + * Ref: AbstractDelegationTokenSelector in Hadoop. If there exists such a token + * in the token cache (credential store) of the job, the lookup returns that. + * This is relevant only when running against a "secure" hadoop release + * The method gets hold of the tokens if they are set up by hadoop - this should + * happen on the map/reduce tasks if the client added the tokens into hadoop's + * credential store in the front end during job submission. The method will + * select the hive delegation token among the set of tokens and return the string + * form of it + * @param tokenSignature + * @return the string form of the token found + * @throws IOException + */ + String getTokenStrForm(String tokenSignature) throws IOException; + /** * InputSplitShim. * diff --git shims/src/common/java/org/apache/hadoop/hive/thrift/HadoopThriftAuthBridge.java shims/src/common/java/org/apache/hadoop/hive/thrift/HadoopThriftAuthBridge.java index e8d0598..301ad5a 100644 --- shims/src/common/java/org/apache/hadoop/hive/thrift/HadoopThriftAuthBridge.java +++ shims/src/common/java/org/apache/hadoop/hive/thrift/HadoopThriftAuthBridge.java @@ -20,15 +20,15 @@ import java.io.IOException; +import org.apache.hadoop.conf.Configuration; import org.apache.thrift.TProcessor; import org.apache.thrift.transport.TTransport; import org.apache.thrift.transport.TTransportException; import org.apache.thrift.transport.TTransportFactory; - /** * This class is only overridden by the secure hadoop shim. It allows * the Thrift SASL support to bridge to Hadoop's UserGroupInformation - * infrastructure. + * & DelegationToken infrastructure. */ public class HadoopThriftAuthBridge { public Client createClient() { @@ -44,15 +44,33 @@ import org.apache.thrift.transport.TTransportFactory; public static abstract class Client { + /** + * + * @param principalConfig In the case of Kerberos authentication this will + * be the kerberos principal name, for DIGEST-MD5 (delegation token) based + * authentication this will be null + * @param host The metastore server host name + * @param methodStr "KERBEROS" or "DIGEST" + * @param tokenStrForm This is url encoded string form of + * org.apache.hadoop.security.token. + * @param underlyingTransport the underlying transport + * @return the transport + * @throws IOException + */ public abstract TTransport createClientTransport( String principalConfig, String host, - String methodStr, TTransport underlyingTransport) + String methodStr,String tokenStrForm, TTransport underlyingTransport) throws IOException; } public static abstract class Server { public abstract TTransportFactory createTransportFactory() throws TTransportException; public abstract TProcessor wrapProcessor(TProcessor processor); + public abstract void startDelegationTokenSecretManager(Configuration conf) throws IOException; + public abstract String getDelegationToken(String renewer) throws IOException; + public abstract long renewDelegationToken(String tokenStrForm) throws IOException; + public abstract String getDelegationToken(String renewer, String token_signature) throws IOException; + public abstract void cancelDelegationToken(String tokenStrForm) throws IOException; } } diff --git shims/src/test/org/apache/hadoop/hive/thrift/TestHadoop20SAuthBridge.java shims/src/test/org/apache/hadoop/hive/thrift/TestHadoop20SAuthBridge.java new file mode 100644 index 0000000..88d49e3 --- /dev/null +++ shims/src/test/org/apache/hadoop/hive/thrift/TestHadoop20SAuthBridge.java @@ -0,0 +1,195 @@ +/** + * 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.thrift; + +import java.net.InetSocketAddress; +import java.net.Socket; +import java.security.PrivilegedExceptionAction; + +import junit.framework.TestCase; + +import org.apache.hadoop.fs.Path; +import org.apache.hadoop.hive.conf.HiveConf; +import org.apache.hadoop.hive.metastore.HiveMetaStore; +import org.apache.hadoop.hive.metastore.HiveMetaStoreClient; +import org.apache.hadoop.hive.metastore.api.Database; +import org.apache.hadoop.hive.metastore.api.MetaException; +import org.apache.hadoop.security.SaslRpcServer; +import org.apache.hadoop.security.UserGroupInformation; +import org.apache.hadoop.security.SaslRpcServer.AuthMethod; +import org.apache.hadoop.security.token.Token; +import org.apache.thrift.transport.TSaslServerTransport; +import org.apache.thrift.transport.TTransportException; +import org.apache.thrift.transport.TTransportFactory; + +public class TestHadoop20SAuthBridge extends TestCase { + + private static class MyHadoopThriftAuthBridge20S extends HadoopThriftAuthBridge20S { + @Override + public Server createServer(String keytabFile, String principalConf) + throws TTransportException { + //Create a Server that doesn't interpret any Kerberos stuff + return new Server(); + } + + static class Server extends HadoopThriftAuthBridge20S.Server { + public Server() throws TTransportException { + super(); + } + @Override + public TTransportFactory createTransportFactory() + throws TTransportException { + TSaslServerTransport.Factory transFactory = + new TSaslServerTransport.Factory(); + transFactory.addServerDefinition(AuthMethod.DIGEST.getMechanismName(), + null, SaslRpcServer.SASL_DEFAULT_REALM, + SaslRpcServer.SASL_PROPS, + new SaslDigestCallbackHandler(secretManager)); + + return new TUGIAssumingTransportFactory(transFactory, realUgi); + } + } + } + private static final int port = 10000; + + private final HiveConf conf; + + public TestHadoop20SAuthBridge(String name) { + super(name); + System.setProperty(HiveConf.ConfVars.METASTORE_USE_THRIFT_SASL.varname, + "true"); + System.setProperty(HiveConf.ConfVars.METASTOREURIS.varname, + "thrift://localhost:" + port); + System.setProperty(HiveConf.ConfVars.METASTOREWAREHOUSE.varname, new Path( + System.getProperty("test.build.data", "/tmp")).toString()); + conf = new HiveConf(TestHadoop20SAuthBridge.class); + conf.setBoolean("hive.metastore.local", false); + } + + public void testSaslWithHiveMetaStore() throws Exception { + + Thread thread = new Thread(new Runnable() { + public void run() { + try { + HiveMetaStore.startMetaStore(port,new MyHadoopThriftAuthBridge20S()); + } catch (Throwable e) { + System.exit(1); + } + } + }); + thread.setDaemon(true); + thread.start(); + loopUntilHMSReady(); + UserGroupInformation clientUgi = UserGroupInformation.getCurrentUser(); + obtainTokenAndAddIntoUGI(clientUgi, null); + obtainTokenAndAddIntoUGI(clientUgi, "tokenForFooTablePartition"); + } + + private void obtainTokenAndAddIntoUGI(UserGroupInformation clientUgi, + String tokenSig) throws Exception { + //obtain a token by directly invoking the metastore operation(without going + //through the thrift interface). Obtaining a token makes the secret manager + //aware of the user and that it gave the token to the user + String tokenStrForm; + if (tokenSig == null) { + tokenStrForm = + HiveMetaStore.getDelegationToken(clientUgi.getShortUserName()); + } else { + tokenStrForm = + HiveMetaStore.getDelegationToken(clientUgi.getShortUserName(), + tokenSig); + conf.set("metastore.token.signature", tokenSig); + } + + Token t= new Token(); + t.decodeFromUrlString(tokenStrForm); + //add the token to the clientUgi for securely talking to the metastore + clientUgi.addToken(t); + //Create the metastore client as the clientUgi. Doing so this + //way will give the client access to the token that was added earlier + //in the clientUgi + HiveMetaStoreClient hiveClient = + clientUgi.doAs(new PrivilegedExceptionAction() { + public HiveMetaStoreClient run() throws Exception { + HiveMetaStoreClient hiveClient = + new HiveMetaStoreClient(conf); + return hiveClient; + } + }); + + assertTrue("Couldn't connect to metastore", hiveClient != null); + + //try out some metastore operations + createDBAndVerifyExistence(hiveClient); + hiveClient.close(); + + //Now cancel the delegation token + HiveMetaStore.cancelDelegationToken(tokenStrForm); + + //now metastore connection should fail + hiveClient = + clientUgi.doAs(new PrivilegedExceptionAction() { + public HiveMetaStoreClient run() { + try { + HiveMetaStoreClient hiveClient = + new HiveMetaStoreClient(conf); + return hiveClient; + } catch (MetaException e) { + return null; + } + } + }); + assertTrue("Expected metastore operations to fail", hiveClient == null); + } + + /** + * A simple connect test to make sure that the metastore is up + * @throws Exception + */ + private void loopUntilHMSReady() throws Exception { + int retries = 0; + Exception exc = null; + while (true) { + try { + Socket socket = new Socket(); + socket.connect(new InetSocketAddress(port), 5000); + socket.close(); + return; + } catch (Exception e) { + if (retries++ > 6) { //give up + exc = e; + break; + } + Thread.sleep(10000); + } + } + throw exc; + } + + private void createDBAndVerifyExistence(HiveMetaStoreClient client) + throws Exception { + String dbName = "simpdb"; + Database db = new Database(); + db.setName(dbName); + client.createDatabase(db); + Database db1 = client.getDatabase(dbName); + client.dropDatabase(dbName); + assertTrue("Databases do not match", db1.getName().equals(db.getName())); + } +}