}
@Override
public GrantRevokePrivilegeResponse grant_revoke_privileges(GrantRevokePrivilegeRequest request)
throws MetaException, org.apache.thrift.TException {
GrantRevokePrivilegeResponse response = new GrantRevokePrivilegeResponse();
switch (request.getRequestType()) {
case GRANT: {
boolean result = grant_privileges(request.getPrivileges());
response.setSuccess(result);
break;
}
case REVOKE: {
boolean revokeGrantOption = false;
if (request.isSetRevokeGrantOption()) {
revokeGrantOption = request.isRevokeGrantOption();
}
boolean result = revoke_privileges(request.getPrivileges(), revokeGrantOption);
response.setSuccess(result);
break;
}
default:
throw new MetaException("Unknown request type " + request.getRequestType());
}