Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

HIVE-1696 Add delegation token support to metastore

(Devaraj Das via namit)



git-svn-id: https://svn.apache.org/repos/asf/hive/trunk@1060876 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information...
commit 06a90b3d9774e8c5778fe6013b0066392948ce51 1 parent fce1662
Namit Jain authored
Showing with 9,761 additions and 2,303 deletions.
  1. +3 −0  CHANGES.txt
  2. +7 −0 build-common.xml
  3. +13 −1 build.xml
  4. +19 −0 metastore/if/hive_metastore.thrift
  5. +1,821 −744 metastore/src/gen/thrift/gen-cpp/ThriftHiveMetastore.cpp
  6. +502 −0 metastore/src/gen/thrift/gen-cpp/ThriftHiveMetastore.h
  7. +20 −0 metastore/src/gen/thrift/gen-cpp/ThriftHiveMetastore_server.skeleton.cpp
  8. +4,390 −1,363 metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/ThriftHiveMetastore.java
  9. +882 −0 metastore/src/gen/thrift/gen-php/hive_metastore/ThriftHiveMetastore.php
  10. +28 −0 metastore/src/gen/thrift/gen-py/hive_metastore/ThriftHiveMetastore-remote
  11. +738 −0 metastore/src/gen/thrift/gen-py/hive_metastore/ThriftHiveMetastore.py
  12. +243 −0 metastore/src/gen/thrift/gen-rb/thrift_hive_metastore.rb
  13. +117 −11 metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java
  14. +67 −4 metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java
  15. +35 −0 metastore/src/java/org/apache/hadoop/hive/metastore/IMetaStoreClient.java
  16. +43 −9 shims/build.xml
  17. +5 −0 shims/src/0.20/java/org/apache/hadoop/hive/shims/Hadoop20Shims.java
  18. +14 −1 shims/src/0.20S/java/org/apache/hadoop/hive/shims/Hadoop20SShims.java
  19. +52 −0 shims/src/0.20S/java/org/apache/hadoop/hive/thrift/DelegationTokenIdentifier.java
  20. +94 −0 shims/src/0.20S/java/org/apache/hadoop/hive/thrift/DelegationTokenSecretManager.java
  21. +33 −0 shims/src/0.20S/java/org/apache/hadoop/hive/thrift/DelegationTokenSelector.java
  22. +397 −163 shims/src/0.20S/java/org/apache/hadoop/hive/thrift/HadoopThriftAuthBridge20S.java
  23. +22 −4 shims/src/common/java/org/apache/hadoop/hive/shims/HadoopShims.java
  24. +21 −3 shims/src/common/java/org/apache/hadoop/hive/thrift/HadoopThriftAuthBridge.java
  25. +195 −0 shims/src/test/org/apache/hadoop/hive/thrift/TestHadoop20SAuthBridge.java
3  CHANGES.txt
View
@@ -143,6 +143,9 @@ Trunk - Unreleased
HIVE-78 Authorization model for Hive
(Yongqiang He via namit)
+ HIVE-1696 Add delegation token support to metastore
+ (Devaraj Das via namit)
+
IMPROVEMENTS
HIVE-1692. FetchOperator.getInputFormatFromCache hides causal exception (Philip Zeyliger via cws)
7 build-common.xml
View
@@ -453,6 +453,13 @@
</junit>
<fail if="tests.failed">Tests failed!</fail>
</target>
+ <target name="test-shims">
+ <subant target="test">
+ <property name="hadoop.version" value="${hadoop.security.version}"/>
+ <property name="hadoop.security.version" value="${hadoop.security.version}"/>
+ <fileset dir="${hive.root}/shims" includes="build.xml"/>
+ </subant>
+ </target>
<target name="clean-test">
<delete dir="${test.build.dir}"/>
14 build.xml
View
@@ -126,6 +126,17 @@
</sequential>
</macrodef>
+ <macrodef name="iterate-test-dirs">
+ <attribute name="target"/>
+ <sequential>
+ <subant target="@{target}">
+ <property name="build.dir.hive" location="${build.dir.hive}"/>
+ <property name="is-offline" value="${is-offline}"/>
+ <filelist dir="." files="common/build.xml,serde/build.xml,metastore/build.xml,ql/build.xml,cli/build.xml,contrib/build.xml,service/build.xml,jdbc/build.xml,hwi/build.xml${hbase.iterate}"/>
+ </subant>
+ </sequential>
+ </macrodef>
+
<macrodef name="iterate">
<attribute name="target"/>
<sequential>
@@ -206,7 +217,8 @@
<target name="test"
depends="clean-test,jar"
description="Run tests">
- <iterate target="test"/>
+ <antcall target="test-shims"/>
+ <iterate-test-dirs target="test"/>
</target>
<!-- create an html report from junit output files -->
19 metastore/if/hive_metastore.thrift
View
@@ -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,
2,565 metastore/src/gen/thrift/gen-cpp/ThriftHiveMetastore.cpp
View
1,821 additions, 744 deletions not shown
502 metastore/src/gen/thrift/gen-cpp/ThriftHiveMetastore.h
View
@@ -67,6 +67,10 @@ class ThriftHiveMetastoreIf : virtual public facebook::fb303::FacebookServiceIf
virtual void list_privileges(std::vector<HiveObjectPrivilege> & _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<ThriftHiveMetastoreIf> 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
20 metastore/src/gen/thrift/gen-cpp/ThriftHiveMetastore_server.skeleton.cpp
View
@@ -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) {
5,753 metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/ThriftHiveMetastore.java
View
4,390 additions, 1,363 deletions not shown
882 metastore/src/gen/thrift/gen-php/hive_metastore/ThriftHiveMetastore.php
View
@@ -62,6 +62,10 @@ public function get_privilege_set($hiveObject, $user_name, $group_names);
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 @@ public function recv_revoke_privileges()
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 @@ public function write($output) {
}
+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;
+ }
+
+}
+
?>
28 metastore/src/gen/thrift/gen-py/hive_metastore/ThriftHiveMetastore-remote
View
@@ -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)
738 metastore/src/gen/thrift/gen-py/hive_metastore/ThriftHiveMetastore.py
View
@@ -458,6 +458,35 @@ def revoke_privileges(self, privileges):
"""
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 @@ def recv_revoke_privileges(self, ):
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 @@ def __init__(self, handler):
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 @@ def process_revoke_privileges(self, seqid, iprot, oprot):
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 @@ def __eq__(self, other):
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()