Search in sources :

Example 1 with PreCreateFunctionEvent

use of org.apache.hadoop.hive.metastore.events.PreCreateFunctionEvent in project hive by apache.

the class CreateFunctionEvent method getOutputHObjs.

private List<HivePrivilegeObject> getOutputHObjs() {
    if (LOG.isDebugEnabled()) {
        LOG.debug("==> CreateFunctionEvent.getOutputHObjs()");
    }
    List<HivePrivilegeObject> ret = new ArrayList<>();
    PreCreateFunctionEvent event = (PreCreateFunctionEvent) preEventContext;
    Function function = event.getFunction();
    List<ResourceUri> uris = function.getResourceUris();
    ret.add(new HivePrivilegeObject(HivePrivilegeObject.HivePrivilegeObjectType.DATABASE, function.getDbName(), null, null, null, HivePrivilegeObject.HivePrivObjectActionType.OTHER, null, null, function.getOwnerName(), function.getOwnerType()));
    ret.add(new HivePrivilegeObject(HivePrivilegeObject.HivePrivilegeObjectType.FUNCTION, function.getDbName(), function.getFunctionName(), null, null, HivePrivilegeObject.HivePrivObjectActionType.OTHER, null, function.getClassName(), function.getOwnerName(), function.getOwnerType()));
    if (uris != null && !uris.isEmpty()) {
        for (ResourceUri uri : uris) {
            ret.add(new HivePrivilegeObject(HivePrivilegeObject.HivePrivilegeObjectType.DFS_URI, null, uri.getUri()));
        }
    }
    COMMAND_STR = buildCommandString(function);
    if (LOG.isDebugEnabled()) {
        LOG.debug("<== CreateFunctionEvent.getOutputHObjs(): ret=" + ret);
    }
    return ret;
}
Also used : Function(org.apache.hadoop.hive.metastore.api.Function) ResourceUri(org.apache.hadoop.hive.metastore.api.ResourceUri) ArrayList(java.util.ArrayList) HivePrivilegeObject(org.apache.hadoop.hive.ql.security.authorization.plugin.HivePrivilegeObject) PreCreateFunctionEvent(org.apache.hadoop.hive.metastore.events.PreCreateFunctionEvent)

Aggregations

ArrayList (java.util.ArrayList)1 Function (org.apache.hadoop.hive.metastore.api.Function)1 ResourceUri (org.apache.hadoop.hive.metastore.api.ResourceUri)1 PreCreateFunctionEvent (org.apache.hadoop.hive.metastore.events.PreCreateFunctionEvent)1 HivePrivilegeObject (org.apache.hadoop.hive.ql.security.authorization.plugin.HivePrivilegeObject)1