You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by da...@apache.org on 2018/05/07 16:55:31 UTC
[2/5] hive git commit: HIVE-19161: Add authorizations to information
schema (Daniel Dai, reviewed by Thejas Nair)
http://git-wip-us.apache.org/repos/asf/hive/blob/7584b327/standalone-metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/ThriftHiveMetastore.java
----------------------------------------------------------------------
diff --git a/standalone-metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/ThriftHiveMetastore.java b/standalone-metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/ThriftHiveMetastore.java
index 652d789..3139058 100644
--- a/standalone-metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/ThriftHiveMetastore.java
+++ b/standalone-metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/ThriftHiveMetastore.java
@@ -296,6 +296,8 @@ import org.slf4j.LoggerFactory;
public GrantRevokePrivilegeResponse grant_revoke_privileges(GrantRevokePrivilegeRequest request) throws MetaException, org.apache.thrift.TException;
+ public GrantRevokePrivilegeResponse refresh_privileges(HiveObjectRef objToRefresh, GrantRevokePrivilegeRequest grantRequest) throws MetaException, org.apache.thrift.TException;
+
public List<String> set_ugi(String user_name, List<String> group_names) throws MetaException, org.apache.thrift.TException;
public String get_delegation_token(String token_owner, String renewer_kerberos_principal_name) throws MetaException, org.apache.thrift.TException;
@@ -710,6 +712,8 @@ import org.slf4j.LoggerFactory;
public void grant_revoke_privileges(GrantRevokePrivilegeRequest request, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+ public void refresh_privileges(HiveObjectRef objToRefresh, GrantRevokePrivilegeRequest grantRequest, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+
public void set_ugi(String user_name, List<String> group_names, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
public void get_delegation_token(String token_owner, String renewer_kerberos_principal_name, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
@@ -4702,6 +4706,33 @@ import org.slf4j.LoggerFactory;
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "grant_revoke_privileges failed: unknown result");
}
+ public GrantRevokePrivilegeResponse refresh_privileges(HiveObjectRef objToRefresh, GrantRevokePrivilegeRequest grantRequest) throws MetaException, org.apache.thrift.TException
+ {
+ send_refresh_privileges(objToRefresh, grantRequest);
+ return recv_refresh_privileges();
+ }
+
+ public void send_refresh_privileges(HiveObjectRef objToRefresh, GrantRevokePrivilegeRequest grantRequest) throws org.apache.thrift.TException
+ {
+ refresh_privileges_args args = new refresh_privileges_args();
+ args.setObjToRefresh(objToRefresh);
+ args.setGrantRequest(grantRequest);
+ sendBase("refresh_privileges", args);
+ }
+
+ public GrantRevokePrivilegeResponse recv_refresh_privileges() throws MetaException, org.apache.thrift.TException
+ {
+ refresh_privileges_result result = new refresh_privileges_result();
+ receiveBase(result, "refresh_privileges");
+ if (result.isSetSuccess()) {
+ return result.success;
+ }
+ if (result.o1 != null) {
+ throw result.o1;
+ }
+ throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "refresh_privileges failed: unknown result");
+ }
+
public List<String> set_ugi(String user_name, List<String> group_names) throws MetaException, org.apache.thrift.TException
{
send_set_ugi(user_name, group_names);
@@ -11338,6 +11369,41 @@ import org.slf4j.LoggerFactory;
}
}
+ public void refresh_privileges(HiveObjectRef objToRefresh, GrantRevokePrivilegeRequest grantRequest, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
+ checkReady();
+ refresh_privileges_call method_call = new refresh_privileges_call(objToRefresh, grantRequest, resultHandler, this, ___protocolFactory, ___transport);
+ this.___currentMethod = method_call;
+ ___manager.call(method_call);
+ }
+
+ @org.apache.hadoop.classification.InterfaceAudience.Public @org.apache.hadoop.classification.InterfaceStability.Stable public static class refresh_privileges_call extends org.apache.thrift.async.TAsyncMethodCall {
+ private HiveObjectRef objToRefresh;
+ private GrantRevokePrivilegeRequest grantRequest;
+ public refresh_privileges_call(HiveObjectRef objToRefresh, GrantRevokePrivilegeRequest grantRequest, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
+ super(client, protocolFactory, transport, resultHandler, false);
+ this.objToRefresh = objToRefresh;
+ this.grantRequest = grantRequest;
+ }
+
+ public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
+ prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("refresh_privileges", org.apache.thrift.protocol.TMessageType.CALL, 0));
+ refresh_privileges_args args = new refresh_privileges_args();
+ args.setObjToRefresh(objToRefresh);
+ args.setGrantRequest(grantRequest);
+ args.write(prot);
+ prot.writeMessageEnd();
+ }
+
+ public GrantRevokePrivilegeResponse getResult() throws MetaException, org.apache.thrift.TException {
+ if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
+ throw new IllegalStateException("Method call not finished!");
+ }
+ org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
+ org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
+ return (new Client(prot)).recv_refresh_privileges();
+ }
+ }
+
public void set_ugi(String user_name, List<String> group_names, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
checkReady();
set_ugi_call method_call = new set_ugi_call(user_name, group_names, resultHandler, this, ___protocolFactory, ___transport);
@@ -13977,6 +14043,7 @@ import org.slf4j.LoggerFactory;
processMap.put("grant_privileges", new grant_privileges());
processMap.put("revoke_privileges", new revoke_privileges());
processMap.put("grant_revoke_privileges", new grant_revoke_privileges());
+ processMap.put("refresh_privileges", new refresh_privileges());
processMap.put("set_ugi", new set_ugi());
processMap.put("get_delegation_token", new get_delegation_token());
processMap.put("renew_delegation_token", new renew_delegation_token());
@@ -17424,6 +17491,30 @@ import org.slf4j.LoggerFactory;
}
}
+ @org.apache.hadoop.classification.InterfaceAudience.Public @org.apache.hadoop.classification.InterfaceStability.Stable public static class refresh_privileges<I extends Iface> extends org.apache.thrift.ProcessFunction<I, refresh_privileges_args> {
+ public refresh_privileges() {
+ super("refresh_privileges");
+ }
+
+ public refresh_privileges_args getEmptyArgsInstance() {
+ return new refresh_privileges_args();
+ }
+
+ protected boolean isOneway() {
+ return false;
+ }
+
+ public refresh_privileges_result getResult(I iface, refresh_privileges_args args) throws org.apache.thrift.TException {
+ refresh_privileges_result result = new refresh_privileges_result();
+ try {
+ result.success = iface.refresh_privileges(args.objToRefresh, args.grantRequest);
+ } catch (MetaException o1) {
+ result.o1 = o1;
+ }
+ return result;
+ }
+ }
+
@org.apache.hadoop.classification.InterfaceAudience.Public @org.apache.hadoop.classification.InterfaceStability.Stable public static class set_ugi<I extends Iface> extends org.apache.thrift.ProcessFunction<I, set_ugi_args> {
public set_ugi() {
super("set_ugi");
@@ -19456,6 +19547,7 @@ import org.slf4j.LoggerFactory;
processMap.put("grant_privileges", new grant_privileges());
processMap.put("revoke_privileges", new revoke_privileges());
processMap.put("grant_revoke_privileges", new grant_revoke_privileges());
+ processMap.put("refresh_privileges", new refresh_privileges());
processMap.put("set_ugi", new set_ugi());
processMap.put("get_delegation_token", new get_delegation_token());
processMap.put("renew_delegation_token", new renew_delegation_token());
@@ -27510,20 +27602,20 @@ import org.slf4j.LoggerFactory;
}
}
- @org.apache.hadoop.classification.InterfaceAudience.Public @org.apache.hadoop.classification.InterfaceStability.Stable public static class set_ugi<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, set_ugi_args, List<String>> {
- public set_ugi() {
- super("set_ugi");
+ @org.apache.hadoop.classification.InterfaceAudience.Public @org.apache.hadoop.classification.InterfaceStability.Stable public static class refresh_privileges<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, refresh_privileges_args, GrantRevokePrivilegeResponse> {
+ public refresh_privileges() {
+ super("refresh_privileges");
}
- public set_ugi_args getEmptyArgsInstance() {
- return new set_ugi_args();
+ public refresh_privileges_args getEmptyArgsInstance() {
+ return new refresh_privileges_args();
}
- public AsyncMethodCallback<List<String>> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
+ public AsyncMethodCallback<GrantRevokePrivilegeResponse> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
final org.apache.thrift.AsyncProcessFunction fcall = this;
- return new AsyncMethodCallback<List<String>>() {
- public void onComplete(List<String> o) {
- set_ugi_result result = new set_ugi_result();
+ return new AsyncMethodCallback<GrantRevokePrivilegeResponse>() {
+ public void onComplete(GrantRevokePrivilegeResponse o) {
+ refresh_privileges_result result = new refresh_privileges_result();
result.success = o;
try {
fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
@@ -27536,7 +27628,7 @@ import org.slf4j.LoggerFactory;
public void onError(Exception e) {
byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
org.apache.thrift.TBase msg;
- set_ugi_result result = new set_ugi_result();
+ refresh_privileges_result result = new refresh_privileges_result();
if (e instanceof MetaException) {
result.o1 = (MetaException) e;
result.setO1IsSet(true);
@@ -27562,25 +27654,25 @@ import org.slf4j.LoggerFactory;
return false;
}
- public void start(I iface, set_ugi_args args, org.apache.thrift.async.AsyncMethodCallback<List<String>> resultHandler) throws TException {
- iface.set_ugi(args.user_name, args.group_names,resultHandler);
+ public void start(I iface, refresh_privileges_args args, org.apache.thrift.async.AsyncMethodCallback<GrantRevokePrivilegeResponse> resultHandler) throws TException {
+ iface.refresh_privileges(args.objToRefresh, args.grantRequest,resultHandler);
}
}
- @org.apache.hadoop.classification.InterfaceAudience.Public @org.apache.hadoop.classification.InterfaceStability.Stable public static class get_delegation_token<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, get_delegation_token_args, String> {
- public get_delegation_token() {
- super("get_delegation_token");
+ @org.apache.hadoop.classification.InterfaceAudience.Public @org.apache.hadoop.classification.InterfaceStability.Stable public static class set_ugi<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, set_ugi_args, List<String>> {
+ public set_ugi() {
+ super("set_ugi");
}
- public get_delegation_token_args getEmptyArgsInstance() {
- return new get_delegation_token_args();
+ public set_ugi_args getEmptyArgsInstance() {
+ return new set_ugi_args();
}
- public AsyncMethodCallback<String> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
+ public AsyncMethodCallback<List<String>> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
final org.apache.thrift.AsyncProcessFunction fcall = this;
- return new AsyncMethodCallback<String>() {
- public void onComplete(String o) {
- get_delegation_token_result result = new get_delegation_token_result();
+ return new AsyncMethodCallback<List<String>>() {
+ public void onComplete(List<String> o) {
+ set_ugi_result result = new set_ugi_result();
result.success = o;
try {
fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
@@ -27593,7 +27685,7 @@ import org.slf4j.LoggerFactory;
public void onError(Exception e) {
byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
org.apache.thrift.TBase msg;
- get_delegation_token_result result = new get_delegation_token_result();
+ set_ugi_result result = new set_ugi_result();
if (e instanceof MetaException) {
result.o1 = (MetaException) e;
result.setO1IsSet(true);
@@ -27619,83 +27711,26 @@ import org.slf4j.LoggerFactory;
return false;
}
- public void start(I iface, get_delegation_token_args args, org.apache.thrift.async.AsyncMethodCallback<String> resultHandler) throws TException {
- iface.get_delegation_token(args.token_owner, args.renewer_kerberos_principal_name,resultHandler);
+ public void start(I iface, set_ugi_args args, org.apache.thrift.async.AsyncMethodCallback<List<String>> resultHandler) throws TException {
+ iface.set_ugi(args.user_name, args.group_names,resultHandler);
}
}
- @org.apache.hadoop.classification.InterfaceAudience.Public @org.apache.hadoop.classification.InterfaceStability.Stable public static class renew_delegation_token<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, renew_delegation_token_args, Long> {
- public renew_delegation_token() {
- super("renew_delegation_token");
+ @org.apache.hadoop.classification.InterfaceAudience.Public @org.apache.hadoop.classification.InterfaceStability.Stable public static class get_delegation_token<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, get_delegation_token_args, String> {
+ public get_delegation_token() {
+ super("get_delegation_token");
}
- public renew_delegation_token_args getEmptyArgsInstance() {
- return new renew_delegation_token_args();
+ public get_delegation_token_args getEmptyArgsInstance() {
+ return new get_delegation_token_args();
}
- public AsyncMethodCallback<Long> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
+ public AsyncMethodCallback<String> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
final org.apache.thrift.AsyncProcessFunction fcall = this;
- return new AsyncMethodCallback<Long>() {
- public void onComplete(Long o) {
- renew_delegation_token_result result = new renew_delegation_token_result();
+ return new AsyncMethodCallback<String>() {
+ public void onComplete(String o) {
+ get_delegation_token_result result = new get_delegation_token_result();
result.success = o;
- result.setSuccessIsSet(true);
- try {
- fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
- return;
- } catch (Exception e) {
- LOGGER.error("Exception writing to internal frame buffer", e);
- }
- fb.close();
- }
- public void onError(Exception e) {
- byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
- org.apache.thrift.TBase msg;
- renew_delegation_token_result result = new renew_delegation_token_result();
- if (e instanceof MetaException) {
- result.o1 = (MetaException) e;
- result.setO1IsSet(true);
- msg = result;
- }
- else
- {
- msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
- msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
- }
- try {
- fcall.sendResponse(fb,msg,msgType,seqid);
- return;
- } catch (Exception ex) {
- LOGGER.error("Exception writing to internal frame buffer", ex);
- }
- fb.close();
- }
- };
- }
-
- protected boolean isOneway() {
- return false;
- }
-
- public void start(I iface, renew_delegation_token_args args, org.apache.thrift.async.AsyncMethodCallback<Long> resultHandler) throws TException {
- iface.renew_delegation_token(args.token_str_form,resultHandler);
- }
- }
-
- @org.apache.hadoop.classification.InterfaceAudience.Public @org.apache.hadoop.classification.InterfaceStability.Stable public static class cancel_delegation_token<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, cancel_delegation_token_args, Void> {
- public cancel_delegation_token() {
- super("cancel_delegation_token");
- }
-
- public cancel_delegation_token_args getEmptyArgsInstance() {
- return new cancel_delegation_token_args();
- }
-
- public AsyncMethodCallback<Void> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
- final org.apache.thrift.AsyncProcessFunction fcall = this;
- return new AsyncMethodCallback<Void>() {
- public void onComplete(Void o) {
- cancel_delegation_token_result result = new cancel_delegation_token_result();
try {
fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
return;
@@ -27707,7 +27742,7 @@ import org.slf4j.LoggerFactory;
public void onError(Exception e) {
byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
org.apache.thrift.TBase msg;
- cancel_delegation_token_result result = new cancel_delegation_token_result();
+ get_delegation_token_result result = new get_delegation_token_result();
if (e instanceof MetaException) {
result.o1 = (MetaException) e;
result.setO1IsSet(true);
@@ -27733,231 +27768,25 @@ import org.slf4j.LoggerFactory;
return false;
}
- public void start(I iface, cancel_delegation_token_args args, org.apache.thrift.async.AsyncMethodCallback<Void> resultHandler) throws TException {
- iface.cancel_delegation_token(args.token_str_form,resultHandler);
- }
- }
-
- @org.apache.hadoop.classification.InterfaceAudience.Public @org.apache.hadoop.classification.InterfaceStability.Stable public static class add_token<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, add_token_args, Boolean> {
- public add_token() {
- super("add_token");
- }
-
- public add_token_args getEmptyArgsInstance() {
- return new add_token_args();
- }
-
- public AsyncMethodCallback<Boolean> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
- final org.apache.thrift.AsyncProcessFunction fcall = this;
- return new AsyncMethodCallback<Boolean>() {
- public void onComplete(Boolean o) {
- add_token_result result = new add_token_result();
- result.success = o;
- result.setSuccessIsSet(true);
- try {
- fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
- return;
- } catch (Exception e) {
- LOGGER.error("Exception writing to internal frame buffer", e);
- }
- fb.close();
- }
- public void onError(Exception e) {
- byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
- org.apache.thrift.TBase msg;
- add_token_result result = new add_token_result();
- {
- msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
- msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
- }
- try {
- fcall.sendResponse(fb,msg,msgType,seqid);
- return;
- } catch (Exception ex) {
- LOGGER.error("Exception writing to internal frame buffer", ex);
- }
- fb.close();
- }
- };
- }
-
- protected boolean isOneway() {
- return false;
- }
-
- public void start(I iface, add_token_args args, org.apache.thrift.async.AsyncMethodCallback<Boolean> resultHandler) throws TException {
- iface.add_token(args.token_identifier, args.delegation_token,resultHandler);
- }
- }
-
- @org.apache.hadoop.classification.InterfaceAudience.Public @org.apache.hadoop.classification.InterfaceStability.Stable public static class remove_token<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, remove_token_args, Boolean> {
- public remove_token() {
- super("remove_token");
- }
-
- public remove_token_args getEmptyArgsInstance() {
- return new remove_token_args();
- }
-
- public AsyncMethodCallback<Boolean> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
- final org.apache.thrift.AsyncProcessFunction fcall = this;
- return new AsyncMethodCallback<Boolean>() {
- public void onComplete(Boolean o) {
- remove_token_result result = new remove_token_result();
- result.success = o;
- result.setSuccessIsSet(true);
- try {
- fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
- return;
- } catch (Exception e) {
- LOGGER.error("Exception writing to internal frame buffer", e);
- }
- fb.close();
- }
- public void onError(Exception e) {
- byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
- org.apache.thrift.TBase msg;
- remove_token_result result = new remove_token_result();
- {
- msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
- msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
- }
- try {
- fcall.sendResponse(fb,msg,msgType,seqid);
- return;
- } catch (Exception ex) {
- LOGGER.error("Exception writing to internal frame buffer", ex);
- }
- fb.close();
- }
- };
- }
-
- protected boolean isOneway() {
- return false;
- }
-
- public void start(I iface, remove_token_args args, org.apache.thrift.async.AsyncMethodCallback<Boolean> resultHandler) throws TException {
- iface.remove_token(args.token_identifier,resultHandler);
- }
- }
-
- @org.apache.hadoop.classification.InterfaceAudience.Public @org.apache.hadoop.classification.InterfaceStability.Stable public static class get_token<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, get_token_args, String> {
- public get_token() {
- super("get_token");
- }
-
- public get_token_args getEmptyArgsInstance() {
- return new get_token_args();
- }
-
- public AsyncMethodCallback<String> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
- final org.apache.thrift.AsyncProcessFunction fcall = this;
- return new AsyncMethodCallback<String>() {
- public void onComplete(String o) {
- get_token_result result = new get_token_result();
- result.success = o;
- try {
- fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
- return;
- } catch (Exception e) {
- LOGGER.error("Exception writing to internal frame buffer", e);
- }
- fb.close();
- }
- public void onError(Exception e) {
- byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
- org.apache.thrift.TBase msg;
- get_token_result result = new get_token_result();
- {
- msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
- msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
- }
- try {
- fcall.sendResponse(fb,msg,msgType,seqid);
- return;
- } catch (Exception ex) {
- LOGGER.error("Exception writing to internal frame buffer", ex);
- }
- fb.close();
- }
- };
- }
-
- protected boolean isOneway() {
- return false;
- }
-
- public void start(I iface, get_token_args args, org.apache.thrift.async.AsyncMethodCallback<String> resultHandler) throws TException {
- iface.get_token(args.token_identifier,resultHandler);
- }
- }
-
- @org.apache.hadoop.classification.InterfaceAudience.Public @org.apache.hadoop.classification.InterfaceStability.Stable public static class get_all_token_identifiers<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, get_all_token_identifiers_args, List<String>> {
- public get_all_token_identifiers() {
- super("get_all_token_identifiers");
- }
-
- public get_all_token_identifiers_args getEmptyArgsInstance() {
- return new get_all_token_identifiers_args();
- }
-
- public AsyncMethodCallback<List<String>> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
- final org.apache.thrift.AsyncProcessFunction fcall = this;
- return new AsyncMethodCallback<List<String>>() {
- public void onComplete(List<String> o) {
- get_all_token_identifiers_result result = new get_all_token_identifiers_result();
- result.success = o;
- try {
- fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
- return;
- } catch (Exception e) {
- LOGGER.error("Exception writing to internal frame buffer", e);
- }
- fb.close();
- }
- public void onError(Exception e) {
- byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
- org.apache.thrift.TBase msg;
- get_all_token_identifiers_result result = new get_all_token_identifiers_result();
- {
- msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
- msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
- }
- try {
- fcall.sendResponse(fb,msg,msgType,seqid);
- return;
- } catch (Exception ex) {
- LOGGER.error("Exception writing to internal frame buffer", ex);
- }
- fb.close();
- }
- };
- }
-
- protected boolean isOneway() {
- return false;
- }
-
- public void start(I iface, get_all_token_identifiers_args args, org.apache.thrift.async.AsyncMethodCallback<List<String>> resultHandler) throws TException {
- iface.get_all_token_identifiers(resultHandler);
+ public void start(I iface, get_delegation_token_args args, org.apache.thrift.async.AsyncMethodCallback<String> resultHandler) throws TException {
+ iface.get_delegation_token(args.token_owner, args.renewer_kerberos_principal_name,resultHandler);
}
}
- @org.apache.hadoop.classification.InterfaceAudience.Public @org.apache.hadoop.classification.InterfaceStability.Stable public static class add_master_key<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, add_master_key_args, Integer> {
- public add_master_key() {
- super("add_master_key");
+ @org.apache.hadoop.classification.InterfaceAudience.Public @org.apache.hadoop.classification.InterfaceStability.Stable public static class renew_delegation_token<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, renew_delegation_token_args, Long> {
+ public renew_delegation_token() {
+ super("renew_delegation_token");
}
- public add_master_key_args getEmptyArgsInstance() {
- return new add_master_key_args();
+ public renew_delegation_token_args getEmptyArgsInstance() {
+ return new renew_delegation_token_args();
}
- public AsyncMethodCallback<Integer> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
+ public AsyncMethodCallback<Long> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
final org.apache.thrift.AsyncProcessFunction fcall = this;
- return new AsyncMethodCallback<Integer>() {
- public void onComplete(Integer o) {
- add_master_key_result result = new add_master_key_result();
+ return new AsyncMethodCallback<Long>() {
+ public void onComplete(Long o) {
+ renew_delegation_token_result result = new renew_delegation_token_result();
result.success = o;
result.setSuccessIsSet(true);
try {
@@ -27971,7 +27800,327 @@ import org.slf4j.LoggerFactory;
public void onError(Exception e) {
byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
org.apache.thrift.TBase msg;
- add_master_key_result result = new add_master_key_result();
+ renew_delegation_token_result result = new renew_delegation_token_result();
+ if (e instanceof MetaException) {
+ result.o1 = (MetaException) e;
+ result.setO1IsSet(true);
+ msg = result;
+ }
+ else
+ {
+ msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
+ msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
+ }
+ try {
+ fcall.sendResponse(fb,msg,msgType,seqid);
+ return;
+ } catch (Exception ex) {
+ LOGGER.error("Exception writing to internal frame buffer", ex);
+ }
+ fb.close();
+ }
+ };
+ }
+
+ protected boolean isOneway() {
+ return false;
+ }
+
+ public void start(I iface, renew_delegation_token_args args, org.apache.thrift.async.AsyncMethodCallback<Long> resultHandler) throws TException {
+ iface.renew_delegation_token(args.token_str_form,resultHandler);
+ }
+ }
+
+ @org.apache.hadoop.classification.InterfaceAudience.Public @org.apache.hadoop.classification.InterfaceStability.Stable public static class cancel_delegation_token<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, cancel_delegation_token_args, Void> {
+ public cancel_delegation_token() {
+ super("cancel_delegation_token");
+ }
+
+ public cancel_delegation_token_args getEmptyArgsInstance() {
+ return new cancel_delegation_token_args();
+ }
+
+ public AsyncMethodCallback<Void> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
+ final org.apache.thrift.AsyncProcessFunction fcall = this;
+ return new AsyncMethodCallback<Void>() {
+ public void onComplete(Void o) {
+ cancel_delegation_token_result result = new cancel_delegation_token_result();
+ try {
+ fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
+ return;
+ } catch (Exception e) {
+ LOGGER.error("Exception writing to internal frame buffer", e);
+ }
+ fb.close();
+ }
+ public void onError(Exception e) {
+ byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
+ org.apache.thrift.TBase msg;
+ cancel_delegation_token_result result = new cancel_delegation_token_result();
+ if (e instanceof MetaException) {
+ result.o1 = (MetaException) e;
+ result.setO1IsSet(true);
+ msg = result;
+ }
+ else
+ {
+ msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
+ msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
+ }
+ try {
+ fcall.sendResponse(fb,msg,msgType,seqid);
+ return;
+ } catch (Exception ex) {
+ LOGGER.error("Exception writing to internal frame buffer", ex);
+ }
+ fb.close();
+ }
+ };
+ }
+
+ protected boolean isOneway() {
+ return false;
+ }
+
+ public void start(I iface, cancel_delegation_token_args args, org.apache.thrift.async.AsyncMethodCallback<Void> resultHandler) throws TException {
+ iface.cancel_delegation_token(args.token_str_form,resultHandler);
+ }
+ }
+
+ @org.apache.hadoop.classification.InterfaceAudience.Public @org.apache.hadoop.classification.InterfaceStability.Stable public static class add_token<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, add_token_args, Boolean> {
+ public add_token() {
+ super("add_token");
+ }
+
+ public add_token_args getEmptyArgsInstance() {
+ return new add_token_args();
+ }
+
+ public AsyncMethodCallback<Boolean> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
+ final org.apache.thrift.AsyncProcessFunction fcall = this;
+ return new AsyncMethodCallback<Boolean>() {
+ public void onComplete(Boolean o) {
+ add_token_result result = new add_token_result();
+ result.success = o;
+ result.setSuccessIsSet(true);
+ try {
+ fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
+ return;
+ } catch (Exception e) {
+ LOGGER.error("Exception writing to internal frame buffer", e);
+ }
+ fb.close();
+ }
+ public void onError(Exception e) {
+ byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
+ org.apache.thrift.TBase msg;
+ add_token_result result = new add_token_result();
+ {
+ msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
+ msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
+ }
+ try {
+ fcall.sendResponse(fb,msg,msgType,seqid);
+ return;
+ } catch (Exception ex) {
+ LOGGER.error("Exception writing to internal frame buffer", ex);
+ }
+ fb.close();
+ }
+ };
+ }
+
+ protected boolean isOneway() {
+ return false;
+ }
+
+ public void start(I iface, add_token_args args, org.apache.thrift.async.AsyncMethodCallback<Boolean> resultHandler) throws TException {
+ iface.add_token(args.token_identifier, args.delegation_token,resultHandler);
+ }
+ }
+
+ @org.apache.hadoop.classification.InterfaceAudience.Public @org.apache.hadoop.classification.InterfaceStability.Stable public static class remove_token<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, remove_token_args, Boolean> {
+ public remove_token() {
+ super("remove_token");
+ }
+
+ public remove_token_args getEmptyArgsInstance() {
+ return new remove_token_args();
+ }
+
+ public AsyncMethodCallback<Boolean> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
+ final org.apache.thrift.AsyncProcessFunction fcall = this;
+ return new AsyncMethodCallback<Boolean>() {
+ public void onComplete(Boolean o) {
+ remove_token_result result = new remove_token_result();
+ result.success = o;
+ result.setSuccessIsSet(true);
+ try {
+ fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
+ return;
+ } catch (Exception e) {
+ LOGGER.error("Exception writing to internal frame buffer", e);
+ }
+ fb.close();
+ }
+ public void onError(Exception e) {
+ byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
+ org.apache.thrift.TBase msg;
+ remove_token_result result = new remove_token_result();
+ {
+ msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
+ msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
+ }
+ try {
+ fcall.sendResponse(fb,msg,msgType,seqid);
+ return;
+ } catch (Exception ex) {
+ LOGGER.error("Exception writing to internal frame buffer", ex);
+ }
+ fb.close();
+ }
+ };
+ }
+
+ protected boolean isOneway() {
+ return false;
+ }
+
+ public void start(I iface, remove_token_args args, org.apache.thrift.async.AsyncMethodCallback<Boolean> resultHandler) throws TException {
+ iface.remove_token(args.token_identifier,resultHandler);
+ }
+ }
+
+ @org.apache.hadoop.classification.InterfaceAudience.Public @org.apache.hadoop.classification.InterfaceStability.Stable public static class get_token<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, get_token_args, String> {
+ public get_token() {
+ super("get_token");
+ }
+
+ public get_token_args getEmptyArgsInstance() {
+ return new get_token_args();
+ }
+
+ public AsyncMethodCallback<String> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
+ final org.apache.thrift.AsyncProcessFunction fcall = this;
+ return new AsyncMethodCallback<String>() {
+ public void onComplete(String o) {
+ get_token_result result = new get_token_result();
+ result.success = o;
+ try {
+ fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
+ return;
+ } catch (Exception e) {
+ LOGGER.error("Exception writing to internal frame buffer", e);
+ }
+ fb.close();
+ }
+ public void onError(Exception e) {
+ byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
+ org.apache.thrift.TBase msg;
+ get_token_result result = new get_token_result();
+ {
+ msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
+ msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
+ }
+ try {
+ fcall.sendResponse(fb,msg,msgType,seqid);
+ return;
+ } catch (Exception ex) {
+ LOGGER.error("Exception writing to internal frame buffer", ex);
+ }
+ fb.close();
+ }
+ };
+ }
+
+ protected boolean isOneway() {
+ return false;
+ }
+
+ public void start(I iface, get_token_args args, org.apache.thrift.async.AsyncMethodCallback<String> resultHandler) throws TException {
+ iface.get_token(args.token_identifier,resultHandler);
+ }
+ }
+
+ @org.apache.hadoop.classification.InterfaceAudience.Public @org.apache.hadoop.classification.InterfaceStability.Stable public static class get_all_token_identifiers<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, get_all_token_identifiers_args, List<String>> {
+ public get_all_token_identifiers() {
+ super("get_all_token_identifiers");
+ }
+
+ public get_all_token_identifiers_args getEmptyArgsInstance() {
+ return new get_all_token_identifiers_args();
+ }
+
+ public AsyncMethodCallback<List<String>> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
+ final org.apache.thrift.AsyncProcessFunction fcall = this;
+ return new AsyncMethodCallback<List<String>>() {
+ public void onComplete(List<String> o) {
+ get_all_token_identifiers_result result = new get_all_token_identifiers_result();
+ result.success = o;
+ try {
+ fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
+ return;
+ } catch (Exception e) {
+ LOGGER.error("Exception writing to internal frame buffer", e);
+ }
+ fb.close();
+ }
+ public void onError(Exception e) {
+ byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
+ org.apache.thrift.TBase msg;
+ get_all_token_identifiers_result result = new get_all_token_identifiers_result();
+ {
+ msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
+ msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
+ }
+ try {
+ fcall.sendResponse(fb,msg,msgType,seqid);
+ return;
+ } catch (Exception ex) {
+ LOGGER.error("Exception writing to internal frame buffer", ex);
+ }
+ fb.close();
+ }
+ };
+ }
+
+ protected boolean isOneway() {
+ return false;
+ }
+
+ public void start(I iface, get_all_token_identifiers_args args, org.apache.thrift.async.AsyncMethodCallback<List<String>> resultHandler) throws TException {
+ iface.get_all_token_identifiers(resultHandler);
+ }
+ }
+
+ @org.apache.hadoop.classification.InterfaceAudience.Public @org.apache.hadoop.classification.InterfaceStability.Stable public static class add_master_key<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, add_master_key_args, Integer> {
+ public add_master_key() {
+ super("add_master_key");
+ }
+
+ public add_master_key_args getEmptyArgsInstance() {
+ return new add_master_key_args();
+ }
+
+ public AsyncMethodCallback<Integer> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
+ final org.apache.thrift.AsyncProcessFunction fcall = this;
+ return new AsyncMethodCallback<Integer>() {
+ public void onComplete(Integer o) {
+ add_master_key_result result = new add_master_key_result();
+ result.success = o;
+ result.setSuccessIsSet(true);
+ try {
+ fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
+ return;
+ } catch (Exception e) {
+ LOGGER.error("Exception writing to internal frame buffer", e);
+ }
+ fb.close();
+ }
+ public void onError(Exception e) {
+ byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
+ org.apache.thrift.TBase msg;
+ add_master_key_result result = new add_master_key_result();
if (e instanceof MetaException) {
result.o1 = (MetaException) e;
result.setO1IsSet(true);
@@ -166468,30 +166617,957 @@ import org.slf4j.LoggerFactory;
@Override
public String toString() {
- StringBuilder sb = new StringBuilder("list_privileges_args(");
+ 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 org.apache.thrift.TException {
+ // check for required fields
+ // check for sub-struct validity
+ if (hiveObject != null) {
+ hiveObject.validate();
+ }
+ }
+
+ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
+ try {
+ write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
+ } catch (org.apache.thrift.TException te) {
+ throw new java.io.IOException(te);
+ }
+ }
+
+ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
+ try {
+ read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
+ } catch (org.apache.thrift.TException te) {
+ throw new java.io.IOException(te);
+ }
+ }
+
+ private static class list_privileges_argsStandardSchemeFactory implements SchemeFactory {
+ public list_privileges_argsStandardScheme getScheme() {
+ return new list_privileges_argsStandardScheme();
+ }
+ }
+
+ private static class list_privileges_argsStandardScheme extends StandardScheme<list_privileges_args> {
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot, list_privileges_args struct) throws org.apache.thrift.TException {
+ org.apache.thrift.protocol.TField schemeField;
+ iprot.readStructBegin();
+ while (true)
+ {
+ schemeField = iprot.readFieldBegin();
+ if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
+ break;
+ }
+ switch (schemeField.id) {
+ case 1: // PRINCIPAL_NAME
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.principal_name = iprot.readString();
+ struct.setPrincipal_nameIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 2: // PRINCIPAL_TYPE
+ if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
+ struct.principal_type = org.apache.hadoop.hive.metastore.api.PrincipalType.findByValue(iprot.readI32());
+ struct.setPrincipal_typeIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 3: // HIVE_OBJECT
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+ struct.hiveObject = new HiveObjectRef();
+ struct.hiveObject.read(iprot);
+ struct.setHiveObjectIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ default:
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ iprot.readFieldEnd();
+ }
+ iprot.readStructEnd();
+ struct.validate();
+ }
+
+ public void write(org.apache.thrift.protocol.TProtocol oprot, list_privileges_args struct) throws org.apache.thrift.TException {
+ struct.validate();
+
+ oprot.writeStructBegin(STRUCT_DESC);
+ if (struct.principal_name != null) {
+ oprot.writeFieldBegin(PRINCIPAL_NAME_FIELD_DESC);
+ oprot.writeString(struct.principal_name);
+ oprot.writeFieldEnd();
+ }
+ if (struct.principal_type != null) {
+ oprot.writeFieldBegin(PRINCIPAL_TYPE_FIELD_DESC);
+ oprot.writeI32(struct.principal_type.getValue());
+ oprot.writeFieldEnd();
+ }
+ if (struct.hiveObject != null) {
+ oprot.writeFieldBegin(HIVE_OBJECT_FIELD_DESC);
+ struct.hiveObject.write(oprot);
+ oprot.writeFieldEnd();
+ }
+ oprot.writeFieldStop();
+ oprot.writeStructEnd();
+ }
+
+ }
+
+ private static class list_privileges_argsTupleSchemeFactory implements SchemeFactory {
+ public list_privileges_argsTupleScheme getScheme() {
+ return new list_privileges_argsTupleScheme();
+ }
+ }
+
+ private static class list_privileges_argsTupleScheme extends TupleScheme<list_privileges_args> {
+
+ @Override
+ public void write(org.apache.thrift.protocol.TProtocol prot, list_privileges_args struct) throws org.apache.thrift.TException {
+ TTupleProtocol oprot = (TTupleProtocol) prot;
+ BitSet optionals = new BitSet();
+ if (struct.isSetPrincipal_name()) {
+ optionals.set(0);
+ }
+ if (struct.isSetPrincipal_type()) {
+ optionals.set(1);
+ }
+ if (struct.isSetHiveObject()) {
+ optionals.set(2);
+ }
+ oprot.writeBitSet(optionals, 3);
+ if (struct.isSetPrincipal_name()) {
+ oprot.writeString(struct.principal_name);
+ }
+ if (struct.isSetPrincipal_type()) {
+ oprot.writeI32(struct.principal_type.getValue());
+ }
+ if (struct.isSetHiveObject()) {
+ struct.hiveObject.write(oprot);
+ }
+ }
+
+ @Override
+ public void read(org.apache.thrift.protocol.TProtocol prot, list_privileges_args struct) throws org.apache.thrift.TException {
+ TTupleProtocol iprot = (TTupleProtocol) prot;
+ BitSet incoming = iprot.readBitSet(3);
+ if (incoming.get(0)) {
+ struct.principal_name = iprot.readString();
+ struct.setPrincipal_nameIsSet(true);
+ }
+ if (incoming.get(1)) {
+ struct.principal_type = org.apache.hadoop.hive.metastore.api.PrincipalType.findByValue(iprot.readI32());
+ struct.setPrincipal_typeIsSet(true);
+ }
+ if (incoming.get(2)) {
+ struct.hiveObject = new HiveObjectRef();
+ struct.hiveObject.read(iprot);
+ struct.setHiveObjectIsSet(true);
+ }
+ }
+ }
+
+ }
+
+ @org.apache.hadoop.classification.InterfaceAudience.Public @org.apache.hadoop.classification.InterfaceStability.Stable public static class list_privileges_result implements org.apache.thrift.TBase<list_privileges_result, list_privileges_result._Fields>, java.io.Serializable, Cloneable, Comparable<list_privileges_result> {
+ private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("list_privileges_result");
+
+ private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0);
+ private static final org.apache.thrift.protocol.TField O1_FIELD_DESC = new org.apache.thrift.protocol.TField("o1", org.apache.thrift.protocol.TType.STRUCT, (short)1);
+
+ private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+ static {
+ schemes.put(StandardScheme.class, new list_privileges_resultStandardSchemeFactory());
+ schemes.put(TupleScheme.class, new list_privileges_resultTupleSchemeFactory());
+ }
+
+ private List<HiveObjectPrivilege> success; // required
+ private MetaException o1; // required
+
+ /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
+ public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+ SUCCESS((short)0, "success"),
+ O1((short)1, "o1");
+
+ private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
+
+ static {
+ for (_Fields field : EnumSet.allOf(_Fields.class)) {
+ byName.put(field.getFieldName(), field);
+ }
+ }
+
+ /**
+ * Find the _Fields constant that matches fieldId, or null if its not found.
+ */
+ public static _Fields findByThriftId(int fieldId) {
+ switch(fieldId) {
+ case 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, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
+ static {
+ Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
+ tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST,
+ new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, HiveObjectPrivilege.class))));
+ tmpMap.put(_Fields.O1, new org.apache.thrift.meta_data.FieldMetaData("o1", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
+ metaDataMap = Collections.unmodifiableMap(tmpMap);
+ org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(list_privileges_result.class, metaDataMap);
+ }
+
+ public list_privileges_result() {
+ }
+
+ public list_privileges_result(
+ List<HiveObjectPrivilege> success,
+ MetaException o1)
+ {
+ this();
+ this.success = success;
+ this.o1 = o1;
+ }
+
+ /**
+ * Performs a deep copy on <i>other</i>.
+ */
+ public list_privileges_result(list_privileges_result other) {
+ if (other.isSetSuccess()) {
+ List<HiveObjectPrivilege> __this__success = new ArrayList<HiveObjectPrivilege>(other.success.size());
+ 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 list_privileges_result deepCopy() {
+ return new list_privileges_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<HiveObjectPrivilege> getSuccessIterator() {
+ return (this.success == null) ? null : this.success.iterator();
+ }
+
+ public void addToSuccess(HiveObjectPrivilege elem) {
+ if (this.success == null) {
+ this.success = new ArrayList<HiveObjectPrivilege>();
+ }
+ this.success.add(elem);
+ }
+
+ public List<HiveObjectPrivilege> getSuccess() {
+ return this.success;
+ }
+
+ public void setSuccess(List<HiveObjectPrivilege> success) {
+ this.success = success;
+ }
+
+ public void unsetSuccess() {
+ this.success = null;
+ }
+
+ /** Returns true if field success is set (has been assigned 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 assigned 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<HiveObjectPrivilege>)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 assigned 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_privileges_result)
+ return this.equals((list_privileges_result)that);
+ return false;
+ }
+
+ public boolean equals(list_privileges_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() {
+ List<Object> list = new ArrayList<Object>();
+
+ boolean present_success = true && (isSetSuccess());
+ list.add(present_success);
+ if (present_success)
+ list.add(success);
+
+ boolean present_o1 = true && (isSetO1());
+ list.add(present_o1);
+ if (present_o1)
+ list.add(o1);
+
+ return list.hashCode();
+ }
+
+ @Override
+ public int compareTo(list_privileges_result other) {
+ if (!getClass().equals(other.getClass())) {
+ return getClass().getName().compareTo(other.getClass().getName());
+ }
+
+ int lastComparison = 0;
+
+ lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetSuccess()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetO1()).compareTo(other.isSetO1());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetO1()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.o1, other.o1);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ return 0;
+ }
+
+ public _Fields fieldForId(int fieldId) {
+ return _Fields.findByThriftId(fieldId);
+ }
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
+ schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
+ }
+
+ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
+ schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder("list_privileges_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 org.apache.thrift.TException {
+ // check for required fields
+ // check for sub-struct validity
+ }
+
+ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
+ try {
+ write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
+ } catch (org.apache.thrift.TException te) {
+ throw new java.io.IOException(te);
+ }
+ }
+
+ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
+ try {
+ read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
+ } catch (org.apache.thrift.TException te) {
+ throw new java.io.IOException(te);
+ }
+ }
+
+ private static class list_privileges_resultStandardSchemeFactory implements SchemeFactory {
+ public list_privileges_resultStandardScheme getScheme() {
+ return new list_privileges_resultStandardScheme();
+ }
+ }
+
+ private static class list_privileges_resultStandardScheme extends StandardScheme<list_privileges_result> {
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot, list_privileges_result struct) throws org.apache.thrift.TException {
+ org.apache.thrift.protocol.TField schemeField;
+ iprot.readStructBegin();
+ while (true)
+ {
+ schemeField = iprot.readFieldBegin();
+ if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
+ break;
+ }
+ switch (schemeField.id) {
+ case 0: // SUCCESS
+ if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
+ {
+ org.apache.thrift.protocol.TList _list1462 = iprot.readListBegin();
+ struct.success = new ArrayList<HiveObjectPrivilege>(_list1462.size);
+ HiveObjectPrivilege _elem1463;
+ for (int _i1464 = 0; _i1464 < _list1462.size; ++_i1464)
+ {
+ _elem1463 = new HiveObjectPrivilege();
+ _elem1463.read(iprot);
+ struct.success.add(_elem1463);
+ }
+ iprot.readListEnd();
+ }
+ struct.setSuccessIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 1: // O1
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+ struct.o1 = new MetaException();
+ struct.o1.read(iprot);
+ struct.setO1IsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ default:
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ iprot.readFieldEnd();
+ }
+ iprot.readStructEnd();
+ struct.validate();
+ }
+
+ public void write(org.apache.thrift.protocol.TProtocol oprot, list_privileges_result struct) throws org.apache.thrift.TException {
+ struct.validate();
+
+ oprot.writeStructBegin(STRUCT_DESC);
+ if (struct.success != null) {
+ oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
+ {
+ oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.success.size()));
+ for (HiveObjectPrivilege _iter1465 : struct.success)
+ {
+ _iter1465.write(oprot);
+ }
+ oprot.writeListEnd();
+ }
+ oprot.writeFieldEnd();
+ }
+ if (struct.o1 != null) {
+ oprot.writeFieldBegin(O1_FIELD_DESC);
+ struct.o1.write(oprot);
+ oprot.writeFieldEnd();
+ }
+ oprot.writeFieldStop();
+ oprot.writeStructEnd();
+ }
+
+ }
+
+ private static class list_privileges_resultTupleSchemeFactory implements SchemeFactory {
+ public list_privileges_resultTupleScheme getScheme() {
+ return new list_privileges_resultTupleScheme();
+ }
+ }
+
+ private static class list_privileges_resultTupleScheme extends TupleScheme<list_privileges_result> {
+
+ @Override
+ public void write(org.apache.thrift.protocol.TProtocol prot, list_privileges_result struct) throws org.apache.thrift.TException {
+ TTupleProtocol oprot = (TTupleProtocol) prot;
+ BitSet optionals = new BitSet();
+ if (struct.isSetSuccess()) {
+ optionals.set(0);
+ }
+ if (struct.isSetO1()) {
+ optionals.set(1);
+ }
+ oprot.writeBitSet(optionals, 2);
+ if (struct.isSetSuccess()) {
+ {
+ oprot.writeI32(struct.success.size());
+ for (HiveObjectPrivilege _iter1466 : struct.success)
+ {
+ _iter1466.write(oprot);
+ }
+ }
+ }
+ if (struct.isSetO1()) {
+ struct.o1.write(oprot);
+ }
+ }
+
+ @Override
+ public void read(org.apache.thrift.protocol.TProtocol prot, list_privileges_result struct) throws org.apache.thrift.TException {
+ TTupleProtocol iprot = (TTupleProtocol) prot;
+ BitSet incoming = iprot.readBitSet(2);
+ if (incoming.get(0)) {
+ {
+ org.apache.thrift.protocol.TList _list1467 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
+ struct.success = new ArrayList<HiveObjectPrivilege>(_list1467.size);
+ HiveObjectPrivilege _elem1468;
+ for (int _i1469 = 0; _i1469 < _list1467.size; ++_i1469)
+ {
+ _elem1468 = new HiveObjectPrivilege();
+ _elem1468.read(iprot);
+ struct.success.add(_elem1468);
+ }
+ }
+ struct.setSuccessIsSet(true);
+ }
+ if (incoming.get(1)) {
+ struct.o1 = new MetaException();
+ struct.o1.read(iprot);
+ struct.setO1IsSet(true);
+ }
+ }
+ }
+
+ }
+
+ @org.apache.hadoop.classification.InterfaceAudience.Public @org.apache.hadoop.classification.InterfaceStability.Stable public static class grant_privileges_args implements org.apache.thrift.TBase<grant_privileges_args, grant_privileges_args._Fields>, java.io.Serializable, Cloneable, Comparable<grant_privileges_args> {
+ private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("grant_privileges_args");
+
+ private static final org.apache.thrift.protocol.TField PRIVILEGES_FIELD_DESC = new org.apache.thrift.protocol.TField("privileges", org.apache.thrift.protocol.TType.STRUCT, (short)1);
+
+ private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+ static {
+ schemes.put(StandardScheme.class, new grant_privileges_argsStandardSchemeFactory());
+ schemes.put(TupleScheme.class, new grant_privileges_argsTupleSchemeFactory());
+ }
+
+ private PrivilegeBag privileges; // required
+
+ /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
+ public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+ PRIVILEGES((short)1, "privileges");
+
+ private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
+
+ static {
+ for (_Fields field : EnumSet.allOf(_Fields.class)) {
+ byName.put(field.getFieldName(), field);
+ }
+ }
+
+ /**
+ * Find the _Fields constant that matches fieldId, or null if its not found.
+ */
+ public static _Fields findByThriftId(int fieldId) {
+ switch(fieldId) {
+ case 1: // PRIVILEGES
+ return PRIVILEGES;
+ default:
+ return null;
+ }
+ }
+
+ /**
+ * Find the _Fields constant that matches fieldId, throwing an exception
+ * if it is not found.
+ */
+ public static _Fields findByThriftIdOrThrow(int fieldId) {
+ _Fields fields = findByThriftId(fieldId);
+ if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
+ return fields;
+ }
+
+ /**
+ * Find the _Fields constant that matches name, or null if its not found.
+ */
+ public static _Fields findByName(String name) {
+ return byName.get(name);
+ }
+
+ private final short _thriftId;
+ private final String _fieldName;
+
+ _Fields(short thriftId, String fieldName) {
+ _thriftId = thriftId;
+ _fieldName = fieldName;
+ }
+
+ public short getThriftFieldId() {
+ return _thriftId;
+ }
+
+ public String getFieldName() {
+ return _fieldName;
+ }
+ }
+
+ // isset id assignments
+ public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
+ static {
+ Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
+ tmpMap.put(_Fields.PRIVILEGES, new org.apache.thrift.meta_data.FieldMetaData("privileges", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, PrivilegeBag.class)));
+ metaDataMap = Collections.unmodifiableMap(tmpMap);
+ org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(grant_privileges_args.class, metaDataMap);
+ }
+
+ public grant_privileges_args() {
+ }
+
+ public grant_privileges_args(
+ PrivilegeBag privileges)
+ {
+ this();
+ this.privileges = privileges;
+ }
+
+ /**
+ * Performs a deep copy on <i>other</i>.
+ */
+ public grant_privileges_args(grant_privileges_args other) {
+ if (other.isSetPrivileges()) {
+ this.privileges = new PrivilegeBag(other.privileges);
+ }
+ }
+
+ public grant_privileges_args deepCopy() {
+ return new grant_privileges_args(this);
+ }
+
+ @Override
+ public void clear() {
+ this.privileges = null;
+ }
+
+ public PrivilegeBag getPrivileges() {
+ return this.privileges;
+ }
+
+ public void setPrivileges(PrivilegeBag privileges) {
+ this.privileges = privileges;
+ }
+
+ public void unsetPrivileges() {
+ this.privileges = null;
+ }
+
+ /** Returns true if field privileges is set (has been assigned a value) and false otherwise */
+ public boolean isSetPrivileges() {
+ return this.privileges != null;
+ }
+
+ public void setPrivilegesIsSet(boolean value) {
+ if (!value) {
+ this.privileges = null;
+ }
+ }
+
+ public void setFieldValue(_Fields field, Object value) {
+ switch (field) {
+ case PRIVILEGES:
+ if (value == null) {
+ unsetPrivileges();
+ } else {
+ setPrivileges((PrivilegeBag)value);
+ }
+ break;
+
+ }
+ }
+
+ public Object getFieldValue(_Fields field) {
+ switch (field) {
+ case PRIVILEGES:
+ return getPrivileges();
+
+ }
+ throw new IllegalStateException();
+ }
+
+ /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
+ public boolean isSet(_Fields field) {
+ if (field == null) {
+ throw new IllegalArgumentException();
+ }
+
+ switch (field) {
+ case PRIVILEGES:
+ return isSetPrivileges();
+ }
+ throw new IllegalStateException();
+ }
+
+ @Override
+ public boolean equals(Object that) {
+ if (that == null)
+ return false;
+ if (that instanceof grant_privileges_args)
+ return this.equals((grant_privileges_args)that);
+ return false;
+ }
+
+ public boolean equals(grant_privileges_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))
+ return false;
+ if (!this.privileges.equals(that.privileges))
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ List<Object> list = new ArrayList<Object>();
+
+ boolean present_privileges = true && (isSetPrivileges());
+ list.add(present_privileges);
+ if (present_privileges)
+ list.add(privileges);
+
+ return list.hashCode();
+ }
+
+ @Override
+ public int compareTo(grant_privileges_args other) {
+ if (!getClass().equals(other.getClass())) {
+ return getClass().getName().compareTo(other.getClass().getName());
+ }
+
+ int lastComparison = 0;
+
+ lastComparison = Boolean.valueOf(isSetPrivileges()).compareTo(other.isSetPrivileges());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetPrivileges()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.privileges, other.privileges);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ return 0;
+ }
+
+ public _Fields fieldForId(int fieldId) {
+ return _Fields.findByThriftId(fieldId);
+ }
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
+ schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
+ }
+
+ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
+ schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder("grant_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("privileges:");
+ if (this.privileges == null) {
sb.append("null");
} else {
- sb.append(this.hiveObject);
+ sb.append(this.privileges);
}
first = false;
sb.append(")");
@@ -166501,8 +167577,8 @@ import org.slf4j.LoggerFactory;
public void validate() throws org.apache.thrift.TException {
// check for required fields
// check for sub-struct validity
- if (hiveObject != null) {
- hiveObject.validate();
+ if (privileges != null) {
+ privileges.validate();
}
}
@@ -166522,15 +167598,15 @@ import org.slf4j.LoggerFactory;
}
}
- private static class list_privileges_argsStandardSchemeFactory implements SchemeFactory {
- public list_privileges_argsStandardScheme getScheme() {
- return new list_privileges_argsStandardScheme();
+ private static class grant_privileges_argsStandardSchemeFactory implements SchemeFactory {
+ public grant_privileges_argsStandardScheme getScheme() {
+ return new grant_privileges_argsStandardScheme();
}
}
- private static class list_privileges_argsStandardScheme extends StandardScheme<list_privileges_args> {
+ private static class grant_privileges_argsStandardScheme extends StandardScheme<grant_privileges_args> {
- public void read(org.apache.thrift.protocol.TProtocol iprot, list_privileges_args struct) throws org.apache.thrift.TException {
+ public void read(org.apache.thrift.protocol.TProtocol iprot, grant_privileges_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
@@ -166540,27 +167616,11 @@ import org.slf4j.LoggerFactory;
break;
}
switch (schemeField.id) {
- case 1: // PRINCIPAL_NAME
- if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
- struct.principal_name = iprot.readString();
- struct.setPrincipal_nameIsSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 2: // PRINCIPAL_TYPE
- if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
- struct.principal_type = org.apache.hadoop.hive.metastore.api.PrincipalType.findByValue(iprot.readI32());
- struct.setPrincipal_typeIsSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 3: // HIVE_OBJECT
+ case 1: // PRIVILEGES
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
- struct.hiveObject = new HiveObjectRef();
- struct.hiveObject.read(iprot);
- struct.setHiveObjectIsSet(true);
+ struct.privileges = new PrivilegeBag();
+ struct.privileges.read(iprot);
+ struct.setPrivilegesIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
@@ -166574,23 +167634,13 @@ import org.slf4j.LoggerFactory;
struct.validate();
}
- public void write(org.apache.thrift.protocol.TProtocol oprot, list_privileges_args struct) throws org.apache.thrift.TException {
+ public void write(org.apache.thrift.protocol.TProtocol oprot, grant_privileges_args struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
- if (struct.principal_name != null) {
- oprot.writeFieldBegin(PRINCIPAL_NAME_FIELD_DESC);
- oprot.writeString(struct.principal_name);
- oprot.writeFieldEnd();
- }
- if (struct.principal_type != null) {
- oprot.writeFieldBegin(PRINCIPAL_TYPE_FIELD_DESC);
- oprot.writeI32(struct.principal_type.getValue());
- oprot.writeFieldEnd();
- }
- if (struct.hiveObject != null) {
- oprot.writeFieldBegin(HIVE_OBJECT_FIELD_DESC);
- struct.hiveObject.write(oprot);
+ if (struct.privileges != null) {
+ oprot.writeFieldBegin(PRIVILEGES_FIELD_DESC);
+ struct.privileges.write(oprot);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
@@ -166599,74 +167649,54 @@ import org.slf4j.LoggerFactory;
}
- private static class list_privileges_argsTupleSchemeFactory implements SchemeFactory {
- public list_privileges_argsTupleScheme getScheme() {
- return new list_privileges_argsTupleScheme();
+ private static class grant_privileges_argsTupleSchemeFactory implements SchemeFactory {
+ public grant_privileges_argsTupleScheme getScheme() {
+ return new grant_privileges_argsTupleScheme();
}
}
- private static class list_privileges_argsTupleScheme extends TupleScheme<list_privileges_args> {
+ private static class grant_privileges_argsTupleScheme extends TupleScheme<grant_privileges_args> {
@Override
- public void write(org.apache.thrift.protocol.TProtocol prot, list_privileges_args struct) throws org.apache.thrift.TException {
+ public void write(org.apache.thrift.protocol.TProtocol prot, grant_privileges_args struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
- if (struct.isSetPrincipal_name()) {
+ if (struct.isSetPrivileges()) {
optionals.set(0);
}
- if (struct.isSetPrincipal_type()) {
- optionals.set(1);
- }
- if (struct.isSetHiveObject()) {
- optionals.set(2);
- }
- oprot.writeBitSet(optionals, 3);
- if (struct.isSetPrincipal_name()) {
- oprot.writeString(struct.principal_name);
- }
- if (struct.isSetPrincipal_type()) {
- oprot.writeI32(struct.principal_type.getValue());
- }
- if (struct.isSetHiveObject()) {
- struct.hiveObject.write(oprot);
+ oprot.writeBitSet(optionals, 1);
+ if (struct.isSetPrivileges()) {
+ struct.privileges.write(oprot);
}
}
@Override
- public void read(org.apache.thrift.protocol.TProtocol prot, list_privileges_args struct) throws org.apache.thrift.TException {
+ public void read(org.apache.thrift.protocol.TProtocol prot, grant_privileges_args struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
- BitSet incoming = iprot.readBitSet(3);
+ BitSet incoming = iprot.readBitSet(1);
if (incoming.get(0)) {
- struct.principal_name = iprot.readString();
- struct.setPrincipal_nameIsSet(true);
- }
- if (incoming.get(1)) {
- struct.principal_type = org.apache.hadoop.hive.metastore.api.PrincipalType.findByValue(iprot.readI32());
- struct.setPrincipal_typeIsSet(true);
- }
- if (incoming.get(2)) {
- struct.hiveObject = new HiveObjectRef();
- struct.hiveObject.read(iprot);
- struct.setHiveObjectIsSet(true);
+ struct.privileges = new PrivilegeBag();
+ struct.privileges.read(iprot);
+ struct.setPrivilegesIsSet(true);
}
}
}
}
- @org.apache.hadoop.classification.InterfaceAudience.Public @org.apache.hadoop.classification.InterfaceStability.Stable public static class list_privileges_result implements org.apache.thrift.TBase<list_privileges_result, list_privileges_result._Fields>, java.io.Serializable, Cloneable, Comparable<list_privileges_result> {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("list_privileges_result");
+ @org.apache.hadoop.classification.InterfaceAudience.Public @org.apache.hadoop.classification.InterfaceStability.Stable public static class grant_privileges_result implements org.apache.thrift.TBase<grant_privileges_result, grant_privileges_result._Fields>, java.io.Serializable, Cloneable, Comparable<grant_privileges_result> {
+ private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("grant_privileges_result");
- private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0);
+ private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.BOOL, (short)0);
private static final org.apache.thrift.protocol.TField O1_FIELD_DESC = new org.apache.thrift.protocol.TField("o1", org.apache.thrift.protocol.TType.STRUCT, (short)1);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
- schemes.put(StandardScheme.class, new list_privileges_resultStandardSchemeFactory());
- schemes.put(TupleScheme.class, new list_privileges_resultTupleSchemeFactory());
+ schemes.put(StandardScheme.class, new grant_privileges_resultStandardSchemeFactory());
+ schemes.put(TupleScheme.class, new grant_privileges_resultTupleSchemeFactory());
}
- private List<HiveObjectPrivilege> success; // required
+ private boolean success; // required
private MetaException o1; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
@@ -166731,92 +167761,74 @@ import org.slf4j.LoggerFactory;
}
// isset id assignments
+ private static final int __SUCCESS_ISSET_ID = 0;
+ private byte __isset_bitfield = 0;
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT,
- new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST,
-
<TRUNCATED>