Java Code Examples for org.apache.hadoop.hive.ql.security.authorization.plugin.HiveOperationType#name()

The following examples show how to use org.apache.hadoop.hive.ql.security.authorization.plugin.HiveOperationType#name() . 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: TestAllHiveOperationInRanger.java    From ranger with Apache License 2.0 6 votes vote down vote up
/**
 * test that all enums in {@link HiveOperationType} match one map entry in
 * RangerHiveOperationType Map
 */
@Test
public void checkHiveOperationTypeMatch() {

    List<String> rangerHiveOperationList = new ArrayList<>();
    for (RangerHiveOperationType rangerHiveOperationType : RangerHiveOperationType.values()) {
        String rangerOpType = rangerHiveOperationType.name();
        rangerHiveOperationList.add(rangerOpType);
    }
    for (HiveOperationType operationType : HiveOperationType.values()) {
        String hiveOperationType = operationType.name();
        if (!rangerHiveOperationList.contains(hiveOperationType)) {
            fail("Unable to find corresponding HiveOperationType in RangerHiveOperation map.Please check this new operation.. "
                    + operationType);
        }
    }
    assert(true);
}
 
Example 2
Source File: RangerHiveAccessRequest.java    From ranger with Apache License 2.0 5 votes vote down vote up
public RangerHiveAccessRequest(RangerHiveResource      resource,
		   String                  user,
		   Set<String>             userGroups,
		   Set<String>             userRoles,
		   HiveOperationType       hiveOpType,
		   HiveAccessType          accessType,
		   HiveAuthzContext        context,
		   HiveAuthzSessionContext sessionContext) {
	this(resource, user, userGroups, userRoles, hiveOpType.name(), accessType, context, sessionContext);
}