Java Code Examples for org.apache.hadoop.hive.metastore.api.GrantRevokeRoleRequest

The following examples show how to use org.apache.hadoop.hive.metastore.api.GrantRevokeRoleRequest. These examples are extracted from open source projects. 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 Project: presto   Source File: ThriftHiveMetastoreClient.java    License: 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 Project: presto   Source File: ThriftHiveMetastoreClient.java    License: 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 Project: waggle-dance   Source File: FederatedHMSHandler.java    License: 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 Project: waggle-dance   Source File: FederatedHMSHandlerTest.java    License: Apache License 2.0 4 votes vote down vote up
@Test
public void grant_revoke_role() throws TException {
  GrantRevokeRoleRequest request = new GrantRevokeRoleRequest();
  handler.grant_revoke_role(request);
  verify(primaryClient).grant_revoke_role(request);
}
 
Example 5
Source Project: metacat   Source File: CatalogThriftHiveMetastore.java    License: 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});
}