org.apache.hadoop.hive.metastore.api.GrantRevokeRoleResponse Java Examples

The following examples show how to use org.apache.hadoop.hive.metastore.api.GrantRevokeRoleResponse. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ThriftHiveMetastoreClient.java    From presto with Apache License 2.0 6 votes vote down vote up
private void createGrant(String role, String granteeName, PrincipalType granteeType, String grantorName, PrincipalType grantorType, boolean grantOption)
        throws TException
{
    GrantRevokeRoleRequest request = new GrantRevokeRoleRequest();
    request.setRequestType(GrantRevokeType.GRANT);
    request.setRoleName(role);
    request.setPrincipalName(granteeName);
    request.setPrincipalType(granteeType);
    request.setGrantor(grantorName);
    request.setGrantorType(grantorType);
    request.setGrantOption(grantOption);
    GrantRevokeRoleResponse response = client.grant_revoke_role(request);
    if (!response.isSetSuccess()) {
        throw new MetaException("GrantRevokeResponse missing success field");
    }
}
 
Example #2
Source File: ThriftHiveMetastoreClient.java    From presto with Apache License 2.0 5 votes vote down vote up
private void removeGrant(String role, String granteeName, PrincipalType granteeType, boolean grantOption)
        throws TException
{
    GrantRevokeRoleRequest request = new GrantRevokeRoleRequest();
    request.setRequestType(GrantRevokeType.REVOKE);
    request.setRoleName(role);
    request.setPrincipalName(granteeName);
    request.setPrincipalType(granteeType);
    request.setGrantOption(grantOption);
    GrantRevokeRoleResponse response = client.grant_revoke_role(request);
    if (!response.isSetSuccess()) {
        throw new MetaException("GrantRevokeResponse missing success field");
    }
}
 
Example #3
Source File: FederatedHMSHandler.java    From waggle-dance with Apache License 2.0 4 votes vote down vote up
@Override
@Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME)
public GrantRevokeRoleResponse grant_revoke_role(GrantRevokeRoleRequest request) throws MetaException, TException {
  return getPrimaryClient().grant_revoke_role(request);
}
 
Example #4
Source File: CatalogThriftHiveMetastore.java    From metacat with Apache License 2.0 4 votes vote down vote up
/**
 * {@inheritDoc}
 */
@Override
public GrantRevokeRoleResponse grant_revoke_role(final GrantRevokeRoleRequest request) throws TException {
    throw unimplemented("grant_revoke_role", new Object[]{request});
}