Search in sources :

Example 1 with GrantRevokeRoleRequest

use of org.apache.hadoop.hive.metastore.api.GrantRevokeRoleRequest in project hetu-core by openlookeng.

the class ThriftHiveMetastoreClient method createGrant.

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");
    }
}
Also used : GrantRevokeRoleResponse(org.apache.hadoop.hive.metastore.api.GrantRevokeRoleResponse) GrantRevokeRoleRequest(org.apache.hadoop.hive.metastore.api.GrantRevokeRoleRequest) MetaException(org.apache.hadoop.hive.metastore.api.MetaException)

Example 2 with GrantRevokeRoleRequest

use of org.apache.hadoop.hive.metastore.api.GrantRevokeRoleRequest in project urban-eureka by errir503.

the class ThriftHiveMetastoreClient method createGrant.

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");
    }
}
Also used : GrantRevokeRoleResponse(org.apache.hadoop.hive.metastore.api.GrantRevokeRoleResponse) GrantRevokeRoleRequest(org.apache.hadoop.hive.metastore.api.GrantRevokeRoleRequest) MetaException(org.apache.hadoop.hive.metastore.api.MetaException)

Example 3 with GrantRevokeRoleRequest

use of org.apache.hadoop.hive.metastore.api.GrantRevokeRoleRequest in project trino by trinodb.

the class ThriftHiveMetastoreClient method removeGrant.

private void removeGrant(String role, String granteeName, PrincipalType granteeType, boolean grantOption) throws TException {
    GrantRevokeRoleRequest request = new GrantRevokeRoleRequest();
    request.setRequestType(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");
    }
}
Also used : GrantRevokeRoleResponse(org.apache.hadoop.hive.metastore.api.GrantRevokeRoleResponse) GrantRevokeRoleRequest(org.apache.hadoop.hive.metastore.api.GrantRevokeRoleRequest) MetaException(org.apache.hadoop.hive.metastore.api.MetaException)

Example 4 with GrantRevokeRoleRequest

use of org.apache.hadoop.hive.metastore.api.GrantRevokeRoleRequest in project presto by prestodb.

the class ThriftHiveMetastoreClient method createGrant.

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");
    }
}
Also used : GrantRevokeRoleResponse(org.apache.hadoop.hive.metastore.api.GrantRevokeRoleResponse) GrantRevokeRoleRequest(org.apache.hadoop.hive.metastore.api.GrantRevokeRoleRequest) MetaException(org.apache.hadoop.hive.metastore.api.MetaException)

Example 5 with GrantRevokeRoleRequest

use of org.apache.hadoop.hive.metastore.api.GrantRevokeRoleRequest in project presto by prestodb.

the class ThriftHiveMetastoreClient method removeGrant.

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");
    }
}
Also used : GrantRevokeRoleResponse(org.apache.hadoop.hive.metastore.api.GrantRevokeRoleResponse) GrantRevokeRoleRequest(org.apache.hadoop.hive.metastore.api.GrantRevokeRoleRequest) MetaException(org.apache.hadoop.hive.metastore.api.MetaException)

Aggregations

GrantRevokeRoleRequest (org.apache.hadoop.hive.metastore.api.GrantRevokeRoleRequest)8 GrantRevokeRoleResponse (org.apache.hadoop.hive.metastore.api.GrantRevokeRoleResponse)8 MetaException (org.apache.hadoop.hive.metastore.api.MetaException)8